Skip to content

Commit

Permalink
Deprecate import-index rule (#1787)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
fisker and sindresorhus committed Apr 2, 2022
1 parent 67bc49f commit 0034e69
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 339 deletions.
1 change: 0 additions & 1 deletion configs/recommended.js
Expand Up @@ -22,7 +22,6 @@ module.exports = {
'unicorn/expiring-todo-comments': 'error',
'unicorn/explicit-length-check': 'error',
'unicorn/filename-case': 'error',
'unicorn/import-index': 'off',
'unicorn/import-style': 'error',
'unicorn/new-for-builtins': 'error',
'unicorn/no-abusive-eslint-disable': 'error',
Expand Down
4 changes: 4 additions & 0 deletions docs/deprecated-rules.md
@@ -1,5 +1,9 @@
# Deprecated Rules

## import-index

This rule is outdated. JavaScript modules (ESM) do not support importing a directory.

## no-array-instanceof

This rule was renamed to [`no-instanceof-array`](rules/no-instanceof-array.md) to be more correct.
Expand Down
85 changes: 0 additions & 85 deletions docs/rules/import-index.md

This file was deleted.

1 change: 1 addition & 0 deletions index.js
Expand Up @@ -6,6 +6,7 @@ const allRulesEnabledConfig = require('./configs/all.js');

const deprecatedRules = createDeprecatedRules({
// {ruleId: ReplacementRuleId | ReplacementRuleId[]}, if no replacement, use `{ruleId: []}`
'import-index': [],
'no-array-instanceof': 'unicorn/no-instanceof-array',
'no-fn-reference-in-iterator': 'unicorn/no-array-callback-reference',
'no-reduce': 'unicorn/no-array-reduce',
Expand Down
1 change: 0 additions & 1 deletion readme.md
Expand Up @@ -64,7 +64,6 @@ Each rule has emojis denoting:
| [expiring-todo-comments](docs/rules/expiring-todo-comments.md) | Add expiration conditions to TODO comments. || | |
| [explicit-length-check](docs/rules/explicit-length-check.md) | Enforce explicitly comparing the `length` or `size` property of a value. || 🔧 | 💡 |
| [filename-case](docs/rules/filename-case.md) | Enforce a case style for filenames. || | |
| [import-index](docs/rules/import-index.md) | Enforce importing index files with `.`. | | 🔧 | |
| [import-style](docs/rules/import-style.md) | Enforce specific import styles per module. || | |
| [new-for-builtins](docs/rules/new-for-builtins.md) | Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`. || 🔧 | |
| [no-abusive-eslint-disable](docs/rules/no-abusive-eslint-disable.md) | Enforce specifying rules to disable in `eslint-disable` comments. || | |
Expand Down
63 changes: 0 additions & 63 deletions rules/import-index.js

This file was deleted.

187 changes: 0 additions & 187 deletions test/import-index.mjs

This file was deleted.

2 changes: 0 additions & 2 deletions test/run-rules-on-codebase/lint.mjs
Expand Up @@ -29,8 +29,6 @@ const eslint = new ESLint({
// Annoying
'unicorn/no-keyword-prefix': 'off',
'unicorn/no-unsafe-regex': 'off',
// Outdated
'unicorn/import-index': 'off',
// Not ready yet
'unicorn/prefer-string-replace-all': 'off',
'unicorn/prefer-top-level-await': 'off',
Expand Down

0 comments on commit 0034e69

Please sign in to comment.