Skip to content

Commit

Permalink
Update Rule Blocklist
Browse files Browse the repository at this point in the history
Remove:

* import/extensions - it does not fail when can not resolve module, uses
  literal value instead
* import/no-absolute-path - does not use module resolution, checks
  whether literal value starts with "/"

Add:

* import/no-restricted-paths - relies on absolutely resolved module
  paths
* node/no-hide-code-modules - relies on module resolution, also
  deprecated
  • Loading branch information
pointlessone authored and dblandin committed Apr 11, 2017
1 parent 1a40f87 commit af1fe5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/rule_blocklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const Config = require("eslint/lib/config")
, merge = require("eslint/lib/config/config-ops").merge;

const blocklistedRules = [
"import/no-restricted-paths",
"import/no-unresolved",
"import/extensions",
"import/no-absolute-path"
"node/no-hide-code-modules"
];

function filterRules(rules) {
Expand Down
12 changes: 6 additions & 6 deletions test/rule_blocklist_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ describe("ConfigUpgrader", function() {
describe("rules", function() {
[
[
{rules: {"import/no-unresolved": [2, "opt1", "opt2"]}},
{rules: {"import/no-unresolved": "off"}}
{rules: {"import/no-restricted-paths": 1}},
{rules: {"import/no-restricted-paths": "off"}}
],
[
{rules: {"import/extensions": 2}},
{rules: {"import/extensions": "off"}}
{rules: {"import/no-unresolved": [2, "opt1", "opt2"]}},
{rules: {"import/no-unresolved": "off"}}
],
[
{rules: {"import/no-absolute-path": 1}},
{rules: {"import/no-absolute-path": "off"}}
{rules: {"node/no-hide-code-modules": 2}},
{rules: {"node/no-hide-code-modules": "off"}}
]
].forEach(function(example){
let originalConfig = example[0];
Expand Down

0 comments on commit af1fe5e

Please sign in to comment.