diff --git a/.eslintrc b/.eslintrc index 0caac0d6d7f924..3f1c59d4df004b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,6 +13,7 @@ }, "plugins": [ + "eslint-comments", "flowtype", "prettier", "react", @@ -58,11 +59,6 @@ }, "rules": { - // Flow Plugin - // The following rules are made available via `eslint-plugin-flowtype` - "flowtype/define-flow-type": 1, - "flowtype/use-flow-type": 1, - // General // This must be disallowed in this repo because the minimum supported @@ -175,6 +171,18 @@ "no-restricted-modules": 1, // restrict usage of specified node modules (off by default) "no-sync": 0, // disallow use of synchronous methods (off by default) + // ESLint Comments Plugin + // The following rules are made available via `eslint-plugin-eslint-comments` + 'eslint-comments/no-aggregating-enable': 1, // disallows eslint-enable comments for multiple eslint-disable comments + 'eslint-comments/no-unlimited-disable': 1, // disallows eslint-disable comments without rule names + 'eslint-comments/no-unused-disable': 1, // disallow disables that don't cover any errors + 'eslint-comments/no-unused-enable': 1, // // disallow enables that don't enable anything or enable rules that weren't disabled + + // Flow Plugin + // The following rules are made available via `eslint-plugin-flowtype` + "flowtype/define-flow-type": 1, + "flowtype/use-flow-type": 1, + // Prettier Plugin // https://github.com/prettier/eslint-plugin-prettier "prettier/prettier": [2, "fb", "@format"], diff --git a/package.json b/package.json index 3be24478dc6cb3..346a93d0d86fca 100644 --- a/package.json +++ b/package.json @@ -204,6 +204,7 @@ "eslint": "^3.19.0", "eslint-config-fb-strict": "^20.0.3", "eslint-config-fbjs": "^1.1.1", + "eslint-plugin-eslint-comments": "^2.0.1", "eslint-plugin-flowtype": "^2.33.0", "eslint-plugin-jest": "^21.5.0", "eslint-plugin-prettier": "2.1.1",