7.9.0 • Published 6 months ago

@sencha/eslint-plugin-extjs v7.9.0

Weekly downloads
11
License
ISC
Repository
-
Last release
6 months ago

eslint-plugin-extjs

ESLint plugin for Ext JS

Installation

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

Configuration

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,

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

Deprecated items

Private items

Removed items