Custom ESLint plugin for Ext JS apps
npm install @sencha/eslint-plugin-extjsESLint plugin for Ext JS
You'll first need to install ESLint:
```
$ npm install eslint --save-dev
Next, 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=@sencha
If 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=@sencha
NOTE: 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-dev
Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-extjs globally.
``
$ npm install @sencha/eslint-plugin-extjs -g
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
}
)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.v8
In eslint , 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.>=8.23.0
So, if your eslint is , you're 100% ready to use the new config system.
You might want to check out the official blog posts,
-
-
-
and the official docs.
js
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
},
}];
``