Migrating guide is provided as a list of different cases "before" and "after".
Inline comments syntax have not changed, but now you need to specify a processor in ESLint config in order for inline comments to work. Same applies for "except" case.
source.js
/* eslint-plugin-disable react */
function greet(name) {
console.log('Hi, ' + name);
}
.eslintrc
{
"plugins": ["import", "react", "jsx-a11y", "disable"],
}
{
"plugins": ["import", "react", "jsx-a11y", "disable"],
+ "processor": "disable/disable"
}
Disables specific plugins for specific file path patterns. In new version all paths options have been removed from settings. Using ESLlint 6+ Overrides from now on (make sure to review the docs for extended configuration options).
.eslintrc
{
"plugins": ["import", "react", "jsx-a11y", "disable"],
- "settings": {
- "eslint-plugin-disable": {
- "paths": {
- "jsx-a11y": ["**/lib/**/*.js"],
- "react": ["**/app/module/*.service.js", "**/*.test.jsx"],
- "*": ["config.js"]
- }
- }
- }
}
{
"plugins": ["import", "react", "jsx-a11y", "disable"],
+ "processor": "disable/disable",
+ "overrides": [
+ {
+ "files": ["lib/**/*.js"],
+ "settings": {
+ "disable/plugins": ["jsx-a11y"],
+ }
+ },
+ {
+ "files": ["app/module/*.service.js", "**/*.test.jsx"],
+ "settings": {
+ "disable/plugins": ["react"]
+ }
+ },
+ {
+ "files": ["config.js"],
+ "settings": {
+ "disable/plugins": "*"
+ }
+ }
+ ]
}
Disables all registered plugins except the ones specified in settings. In new version all paths options have been removed from settings. Using ESLlint 6+ Overrides from now on (make sure to review the docs for extended configuration options).
.eslintrc
{
"plugins": ["import", "react", "jsx-a11y", "disable"],
- "settings": {
- "eslint-plugin-disable": {
- "allExceptPaths": {
- "jsx-a11y": ["**/lib/**/*.js"],
- "react": ["**/app/module/*.service.js", "**/*.test.jsx"]
- }
- }
- }
}
{
"plugins": ["import", "react", "jsx-a11y", "disable"],
+ "processor": "disable/disable",
+ "overrides": [
+ {
+ "files": ["lib/**/*.js"],
+ "settings": {
+ "disable/disableAllExcept": true,
+ "disable/plugins": ["jsx-a11y"],
+ }
+ },
+ {
+ "files": ["app/module/*.service.js", "**/*.test.jsx"],
+ "settings": {
+ "disable/disableAllExcept": true,
+ "disable/plugins": ["react"]
+ }
+ }
+ ]
}
Some ESLint plugins also use processors, which creates a conflict with this plugin, because ESLint does not allow to chain processors for the same source files without processing it and producing another files. "cliArgs" have been used to pass extensions and are now replaced with ESLlint 6+ Overrides so that you can specify which files will be processed. Also hidden integration of conflicting processors now moved to a configurable option "externalProcessor", which accepts a processor identifier "pluginName/processorName" and makes this plugin to call other plugin's processor before disabling the rules.
.eslintrc
{
"extends": [
"plugin:vue/essential",
"plugin:vue/strongly-recommended"
],
"plugins": ["disable"],
- "settings": {
- "eslint-plugin-disable": {
- "paths": {
- "vue": ["**/lib/**/*.vue"]
- },
- "cliArgs": ["--ext", ".js,.vue"]
- }
- }
}
{
"extends": [
"plugin:vue/essential",
"plugin:vue/strongly-recommended"
],
"plugins": ["disable"],
+ "overrides": [
+ {
+ "files": ["lib/**/*.vue"],
+ "processor": "disable/disable",
+ "settings": {
+ "disable/plugins": ["vue"],
+ "disable/externalProcessor": "vue/.vue"
+ }
+ }
+ ]
}