Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate import-index rule #1787

Merged
merged 2 commits into from Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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