Skip to content

Commit

Permalink
Remove import/extensions rule due to low adoption of strict ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
matejchalk committed Nov 18, 2024
1 parent 2c11d48 commit 0e339e8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docs/angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Config for **Angular** projects.
);
```

## πŸ“ Rules (421)
## πŸ“ Rules (420)

**345** rules are included from [`typescript` config](./typescript.md#πŸ“-rules-345). For brevity, only the **76** additional rules are listed in this document.
**344** rules are included from [`typescript` config](./typescript.md#πŸ“-rules-344). For brevity, only the **76** additional rules are listed in this document.

> πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).<br>πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).<br>πŸ§ͺ🚫 Disabled for [test files](../README.md#πŸ§ͺ-test-overrides).<br>πŸ§ͺ⚠️ Severity lessened to warning for [test files](../README.md#πŸ§ͺ-test-overrides).
Expand Down
4 changes: 2 additions & 2 deletions docs/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Config for **GraphQL servers** implemented in Node.js.
export default tseslint.config(...graphql);
```

## πŸ“ Rules (317)
## πŸ“ Rules (316)

**294** rules are included from [`node` config](./node.md#πŸ“-rules-294). For brevity, only the **23** additional rules are listed in this document.
**293** rules are included from [`node` config](./node.md#πŸ“-rules-293). For brevity, only the **23** additional rules are listed in this document.

> πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).<br>πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).<br>πŸ§ͺ🚫 Disabled for [test files](../README.md#πŸ§ͺ-test-overrides).<br>πŸ§ͺ⚠️ Severity lessened to warning for [test files](../README.md#πŸ§ͺ-test-overrides).

Expand Down
5 changes: 2 additions & 3 deletions docs/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Default config, suitable for any **JavaScript/TypeScript** project.

Refer to [setup instructions in README](../README.md#πŸ—οΈ-setup).

## πŸ“ Rules (290)
## πŸ“ Rules (289)

> πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).<br>πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).<br>πŸ§ͺ🚫 Disabled for [test files](../README.md#πŸ§ͺ-test-overrides).<br>πŸ§ͺ⚠️ Severity lessened to warning for [test files](../README.md#πŸ§ͺ-test-overrides).
Expand Down Expand Up @@ -154,7 +154,7 @@ Refer to [setup instructions in README](../README.md#πŸ—οΈ-setup).
| [![sonarjs](./icons/other/sonar.png)](https://github.com/SonarSource/eslint-plugin-sonarjs#readme) | [prefer-single-boolean-return](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/prefer-single-boolean-return.md)<br />Return of boolean expressions should not be wrapped into an "if-then-else" statement | | πŸ’‘ | |
| [![sonarjs](./icons/other/sonar.png)](https://github.com/SonarSource/eslint-plugin-sonarjs#readme) | [prefer-while](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/prefer-while.md)<br />A "while" loop should be used instead of a "for" loop | | πŸ”§ | |

### ⚠️ Warnings (151)
### ⚠️ Warnings (150)

| Plugin | Rule | Options | Autofix | Overrides |
| :--------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-----: | :-------: |
Expand Down Expand Up @@ -191,7 +191,6 @@ Refer to [setup instructions in README](../README.md#πŸ—οΈ-setup).
| [![@typescript-eslint](./icons/material/typescript.png)](https://typescript-eslint.io/) | [prefer-function-type](https://typescript-eslint.io/rules/prefer-function-type)<br />Enforce using function types instead of interfaces with call signatures | | πŸ”§ | |
| [![functional](./icons/icons8/lambda.png)](https://github.com/eslint-functional/eslint-plugin-functional#readme) | [no-let](https://github.com/eslint-functional/eslint-plugin-functional/blob/v7.0.0/docs/rules/no-let.md)<br />Disallow mutable variables. | | | πŸ§ͺ🚫 |
| [![functional](./icons/icons8/lambda.png)](https://github.com/eslint-functional/eslint-plugin-functional#readme) | [no-loop-statements](https://github.com/eslint-functional/eslint-plugin-functional/blob/v7.0.0/docs/rules/no-loop-statements.md)<br />Disallow imperative loops. | | | |
| [![import](./icons/icons8/import.png)](https://github.com/import-js/eslint-plugin-import#readme) | [extensions](https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/extensions.md)<br />Ensure consistent use of file extension within the import path. | <details><summary>always, ignorePackages: tru...</summary><pre lang="json"><code>[&#13; "always",&#13; {&#13; "ignorePackages": true,&#13; "checkTypeImports": true&#13; }&#13;]</code></pre></details> | | |
| [![import](./icons/icons8/import.png)](https://github.com/import-js/eslint-plugin-import#readme) | [max-dependencies](https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/max-dependencies.md)<br />Enforce the maximum number of dependencies a module can have. | <details><summary>ignoreTypeImports: true</summary><pre lang="json"><code>{&#13; "ignoreTypeImports": true&#13;}</code></pre></details> | | |
| [![import](./icons/icons8/import.png)](https://github.com/import-js/eslint-plugin-import#readme) | [no-anonymous-default-export](https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/no-anonymous-default-export.md)<br />Forbid anonymous values as default exports. | | | |
| [![import](./icons/icons8/import.png)](https://github.com/import-js/eslint-plugin-import#readme) | [no-duplicates](https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/no-duplicates.md)<br />Forbid repeated import of the same module in multiple places. | | πŸ”§ | |
Expand Down
4 changes: 2 additions & 2 deletions docs/ngrx.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Config for **Angular** projects using **NgRx** library.
);
```

## πŸ“ Rules (451)
## πŸ“ Rules (450)

**421** rules are included from [`angular` config](./angular.md#πŸ“-rules-421). For brevity, only the **30** additional rules are listed in this document.
**420** rules are included from [`angular` config](./angular.md#πŸ“-rules-420). For brevity, only the **30** additional rules are listed in this document.

> πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).<br>πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).<br>πŸ§ͺ🚫 Disabled for [test files](../README.md#πŸ§ͺ-test-overrides).<br>πŸ§ͺ⚠️ Severity lessened to warning for [test files](../README.md#πŸ§ͺ-test-overrides).
Expand Down
4 changes: 2 additions & 2 deletions docs/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Config for **Node.js** projects.
export default tseslint.config(...node);
```

## πŸ“ Rules (294)
## πŸ“ Rules (293)

**290** rules are included from [`javascript` config](./javascript.md#πŸ“-rules-290). For brevity, only the **4** additional rules are listed in this document.
**289** rules are included from [`javascript` config](./javascript.md#πŸ“-rules-289). For brevity, only the **4** additional rules are listed in this document.

> πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).<br>πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).<br>πŸ§ͺ🚫 Disabled for [test files](../README.md#πŸ§ͺ-test-overrides).<br>πŸ§ͺ⚠️ Severity lessened to warning for [test files](../README.md#πŸ§ͺ-test-overrides).
Expand Down
4 changes: 2 additions & 2 deletions docs/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ Config for strict **TypeScript** projects.
export default tseslint.config(...typescript);
```

## πŸ“ Rules (345)
## πŸ“ Rules (344)

**290** rules are included from [`javascript` config](./javascript.md#πŸ“-rules-290). For brevity, only the **55** additional rules are listed in this document.
**289** rules are included from [`javascript` config](./javascript.md#πŸ“-rules-289). For brevity, only the **55** additional rules are listed in this document.

> πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).<br>πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).<br>πŸ§ͺ🚫 Disabled for [test files](../README.md#πŸ§ͺ-test-overrides).<br>πŸ§ͺ⚠️ Severity lessened to warning for [test files](../README.md#πŸ§ͺ-test-overrides).

Expand Down
11 changes: 6 additions & 5 deletions src/configs/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ export default tseslint.config(
'@typescript-eslint/no-shadow': 'warn',

// https://github.com/import-js/eslint-plugin-import#rules
'import/extensions': [
'warn',
'always',
{ ignorePackages: true, checkTypeImports: true },
],
// probably too strict due to low adoption of strict ESM
// 'import/extensions': [
// 'warn',
// 'always',
// { ignorePackages: true, checkTypeImports: true },
// ],
'import/max-dependencies': ['warn', { ignoreTypeImports: true }],
'import/no-absolute-path': 'error',
'import/no-amd': 'error',
Expand Down

0 comments on commit 0e339e8

Please sign in to comment.