@sencha/eslint-plugin-extjs v7.9.0
eslint-plugin-extjs
ESLint plugin for Ext JS
Installation
You'll first need to install ESLint:
$ npm install eslint --save-devNext, install @sencha/eslint-plugin-extjs:
First, log into the one of Sencha's NPM repositories that hosts this package with the @sencha scope.
If a current customer, you can use https://npm.sencha.com
$ npm login --registry=https://npm.sencha.com --scope=@senchaIf not a current customer you can request access from the Upgrade Adviser product page. And then run the following npm login command.
$ npm login --registry=https://sencha.myget.org/F/extjs-upgrade-adviser/npm/ --scope=@senchaNOTE: In both cases, remember to replace the @ character in your username with '..' two periods.
After you have logged into the correct NPM repo, you can install the package by executing the following:
$ npm install @sencha/eslint-plugin-extjs --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-extjs globally.
$ npm install @sencha/eslint-plugin-extjs -gConfiguration
For the Ext JS plugin, you can enable all of our recommended rules by adding plugin:@sencha/extjs/recommended to the extends section of your .eslintrc configuration file.
"extends": [
"plugin:@sencha/extjs/recommended"
]To add only the rules you want, add @sencha/extjs to the plugins section of your .eslintrc configuration file.
"plugins": [
"@sencha/extjs"
]And then configure the rules you want to use under the rules section.
"rules": {
"@sencha/extjs/rule-name": 2
}Configuration (new: eslint.config.js)
From v8.21.0, eslint announced a new config system.
In the new system, .eslintrc* is no longer used. eslint.config.js would be the default config file name.
In eslint v8, the legacy system (.eslintrc*) would still be supported, while in eslint v9, only the new system would be supported.
And from v8.23.0, eslint CLI starts to look up eslint.config.js.
So, if your eslint is >=8.23.0, you're 100% ready to use the new config system.
You might want to check out the official blog posts,
- https://eslint.org/blog/2022/08/new-config-system-part-1/
- https://eslint.org/blog/2022/08/new-config-system-part-2/
- https://eslint.org/blog/2022/08/new-config-system-part-3/
and the official docs.
Plugin
To configure @sencha/eslint-plugin-extjs in your eslint.config.{js/mjs} file, follow the below example:
export default [...compat.extends("plugin:@sencha/extjs/recommended"), {
languageOptions: {
ecmaVersion: 12,
sourceType: "module",
},
rules: {
semi: ["error", "always"],
quotes: ["error", "single"],
"@sencha/extjs/no-deprecated-class-usage":0
},
}];Supported Rules
Overrides
- @sencha/extjs/no-existing-alias-override: Report the overriding of an existing alias
- @sencha/extjs/no-existing-class-override: Report the overriding of an existing Class
- @sencha/extjs/no-existing-method-override: Report the overriding of an existing method
- @sencha/extjs/override-method-call: Report the calling of the override method
Deprecated items
- @sencha/extjs/no-deprecated-class-usage: Report the usage of a deprecated Class
- @sencha/extjs/no-deprecated-config-usage: Report the usage of a deprecated config
- @sencha/extjs/no-deprecated-method-call: Report the calling of a deprecated method
- @sencha/extjs/no-deprecated-method-override: Report the overriding of a deprecated method
- @sencha/extjs/no-deprecated-property-usage: Report the usage of a deprecated property
Private items
- @sencha/extjs/no-private-class-usage: Report the usage of a private Class
- @sencha/extjs/no-private-config-usage: Report the usage of a private config
- @sencha/extjs/no-private-method-call: Report the calling of a private method
- @sencha/extjs/no-private-method-override: Report the overriding of a private method
- @sencha/extjs/no-private-property-usage: Report the usage of a private property
Removed items
- @sencha/extjs/no-removed-class-usage: Report the usage of a removed Class
- @sencha/extjs/no-removed-config-usage: Report the usage of a removed config
- @sencha/extjs/no-removed-method-call: Report the calling of a removed method
- @sencha/extjs/no-removed-method-override: Report the overriding of a removed method
- @sencha/extjs/no-removed-property-usage: Report the usage of a removed property