Skip to content

Commit 0034e69

Browse files
fiskersindresorhus
andauthored
Deprecate import-index rule (#1787)
Co-authored-by: Sindre Sorhus <[email protected]>
1 parent 67bc49f commit 0034e69

File tree

8 files changed

+5
-339
lines changed

8 files changed

+5
-339
lines changed

configs/recommended.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ module.exports = {
2222
'unicorn/expiring-todo-comments': 'error',
2323
'unicorn/explicit-length-check': 'error',
2424
'unicorn/filename-case': 'error',
25-
'unicorn/import-index': 'off',
2625
'unicorn/import-style': 'error',
2726
'unicorn/new-for-builtins': 'error',
2827
'unicorn/no-abusive-eslint-disable': 'error',

docs/deprecated-rules.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Deprecated Rules
22

3+
## import-index
4+
5+
This rule is outdated. JavaScript modules (ESM) do not support importing a directory.
6+
37
## no-array-instanceof
48

59
This rule was renamed to [`no-instanceof-array`](rules/no-instanceof-array.md) to be more correct.

docs/rules/import-index.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const allRulesEnabledConfig = require('./configs/all.js');
66

77
const deprecatedRules = createDeprecatedRules({
88
// {ruleId: ReplacementRuleId | ReplacementRuleId[]}, if no replacement, use `{ruleId: []}`
9+
'import-index': [],
910
'no-array-instanceof': 'unicorn/no-instanceof-array',
1011
'no-fn-reference-in-iterator': 'unicorn/no-array-callback-reference',
1112
'no-reduce': 'unicorn/no-array-reduce',

readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ Each rule has emojis denoting:
6464
| [expiring-todo-comments](docs/rules/expiring-todo-comments.md) | Add expiration conditions to TODO comments. || | |
6565
| [explicit-length-check](docs/rules/explicit-length-check.md) | Enforce explicitly comparing the `length` or `size` property of a value. || 🔧 | 💡 |
6666
| [filename-case](docs/rules/filename-case.md) | Enforce a case style for filenames. || | |
67-
| [import-index](docs/rules/import-index.md) | Enforce importing index files with `.`. | | 🔧 | |
6867
| [import-style](docs/rules/import-style.md) | Enforce specific import styles per module. || | |
6968
| [new-for-builtins](docs/rules/new-for-builtins.md) | Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`. || 🔧 | |
7069
| [no-abusive-eslint-disable](docs/rules/no-abusive-eslint-disable.md) | Enforce specifying rules to disable in `eslint-disable` comments. || | |

rules/import-index.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

test/import-index.mjs

Lines changed: 0 additions & 187 deletions
This file was deleted.

test/run-rules-on-codebase/lint.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ const eslint = new ESLint({
2929
// Annoying
3030
'unicorn/no-keyword-prefix': 'off',
3131
'unicorn/no-unsafe-regex': 'off',
32-
// Outdated
33-
'unicorn/import-index': 'off',
3432
// Not ready yet
3533
'unicorn/prefer-string-replace-all': 'off',
3634
'unicorn/prefer-top-level-await': 'off',

0 commit comments

Comments
 (0)