eslint-plugin-import
eslint-plugin-import copied to clipboard
ESLint plugin with rules that help validate proper imports.
It would be helpful to include the `description` property for each rule. Personally, I like to use a simple script which uses meta information such as the URL (which is...
`import/extensions` rule does not detect `export ... from` syntax without an extension. config: `"import/extensions": ["error", "always"]` package version: `2.22.1`
```ts import type ESLint from 'eslint' import type { Linter, SourceCode } from 'eslint' ``` If I merge them into one statement: ```ts import type ESLint, { Linter, SourceCode }...
If there is no `package.json`-file in the file to check (or any parent directory), the `eslint`-run fails due to this piece of code: https://github.com/benmosher/eslint-plugin-import/blob/802ce7d49d912289d590f735bf9bd2d931064863/src/core/packagePath.js#L11-L12 Following error is reported: ``` TypeError...
In TypeScript, it is common to write declaration files for 3rd-party modules or global variables. For example, a file called "foo.d.ts": ```typescript declare const foo: number; ``` However, this file...
Refactoring some code today in a package called 'our-utils' I noticed one of the files in that package was importing like: ```js import { someDep } from 'our-utils'; ``` Now...
In our monorepo we store our internal packages under `./packages` So we tried a config like this: ```js rules: { 'import/order': 'warn', }, settings: { 'import/internal-regex': '^internal-', // This makes...
This is more of a low-priority FYI, given that `no-unresolved` always gets fixed right away, so the issue is inconsequential.  I haven't specified `import/extensions` rule and thus the default...
I'd like to be able to detect when I'm requiring a file that has no exports. Maybe more specifically when I try to assign it to a variable. For example:...
`Node.js` doesn’t supports imports without file extension: ```js import client from './client'; ``` This will be error, extension should be provided: ```js import client from './client.js'; ``` Extensions can be:...