Skip to content

tsedio/eslint-plugin-tsed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ts.ED logo


Build & Release PR Welcome npm version npm-tag semantic-release code style: prettier github opencollective

Website   •   Getting started   •   Slack   •   Twitter

A note on versions

  • Version 5.x supports Eslint version >=8.x and typescript eslint parser ^7
  • Version 4.x supports Eslint version >=8.x and typescript eslint parser ^6
  • Version 3.x supports Eslint version >=8.x and typescript eslint parser ^5
  • Version 2.x supports Eslint version <=7.x and typescript eslint parser ^4

There are breaking changes between versions ofr ts-eslint.

typescript eslint parser supports a range of typescript versions but there can be a delay in supporting the latest versions.

This plugin only supports typescript up to the version typescript eslint parser supports. See https://github.com/typescript-eslint/typescript-eslint#supported-typescript-version for the versions.

Have an idea for a rule?

Awesome! Click here to submit a new issue!

Index of available rules

Category Rule Auto-fix is on in recommended ruleset?
Preventing Bugs explicit-required-decorator
explicit-collection-of-decorator
no-duplicate-decorators
Code Consistency unused-imported-specifier

The "recommended" ruleset are the default rules that are turned on when you configure the plugin as described in this document.

The name "recommended" is an eslint convention. Some rules in this plugin are opinionated and have to be turned on explicitly in your eslintrc file.

Who is this package for?

If you use Ts.ED (https://tsed.io/) these ESLint rules will help you to prevent common bugs and issues in Ts.ED applications.

They mostly check that you are using decorators correctly.

To install

The plugin is on npm here: https://www.npmjs.com/package/@tsed/eslint-plugin

npm install --save-dev @tsed/eslint-plugin

// or

yarn add -D @tsed/eslint-plugin
// or

pnpm add -D @tsed/eslint-plugin

To configure

Update your eslint with the plugin import and add the recommended rule set

module.exports = {
  env: {
    es6: true,
  },
  extends: ["plugin:@tsed/recommended"],
  parser: "@typescript-eslint/parser",
  plugins: ["@tsed"],
};

Contributors

Please read contributing guidelines here.

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

The MIT License (MIT)

Copyright (c) 2016 - 2024 Romain Lenzotti

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.