diff --git a/.coveralls.yml b/.coveralls.yml index 77bcfb374..b8ebe05a1 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1,2 +1,2 @@ --- -repo_token: fW3moW39Z8pKOgqTnUMT68DnNCd2SM8Ly \ No newline at end of file +repo_token: fW3moW39Z8pKOgqTnUMT68DnNCd2SM8Ly diff --git a/docs/rules/no-unused-modules.md b/docs/rules/no-unused-modules.md index 8c234202f..4c04333ad 100644 --- a/docs/rules/no-unused-modules.md +++ b/docs/rules/no-unused-modules.md @@ -12,7 +12,7 @@ Note: dynamic imports are currently not supported. In order for this plugin to work, one of the options `missingExports` or `unusedExports` must be enabled (see "Options" section below). In the future, these options will be enabled by default (see https://github.com/benmosher/eslint-plugin-import/issues/1324) -Example: +Example: ``` "rules: { ...otherRules, @@ -27,13 +27,13 @@ This rule takes the following option: - **`missingExports`**: if `true`, files without any exports are reported (defaults to `false`) - **`unusedExports`**: if `true`, exports without any static usage within other modules are reported (defaults to `false`) - `src`: an array with files/paths to be analyzed. It only applies to unused exports. Defaults to `process.cwd()`, if not provided -- `ignoreExports`: an array with files/paths for which unused exports will not be reported (e.g module entry points in a published package) +- `ignoreExports`: an array with files/paths for which unused exports will not be reported (e.g module entry points in a published package) ### Example for missing exports #### The following will be reported ```js -const class MyClass { /*...*/ } +const class MyClass { /*...*/ } function makeClass() { return new MyClass(...arguments) } ``` @@ -41,10 +41,10 @@ function makeClass() { return new MyClass(...arguments) } #### The following will not be reported ```js -export default function () { /*...*/ } +export default function () { /*...*/ } ``` ```js -export const foo = function () { /*...*/ } +export const foo = function () { /*...*/ } ``` ```js export { foo, bar } @@ -61,7 +61,7 @@ import { f } from 'file-b' import * as fileC from 'file-c' export { default, i0 } from 'file-d' // both will be reported -export const j = 99 // will be reported +export const j = 99 // will be reported ``` and file-d: ```js diff --git a/tests/src/rules/named.js b/tests/src/rules/named.js index eba7bec1a..030368877 100644 --- a/tests/src/rules/named.js +++ b/tests/src/rules/named.js @@ -286,9 +286,9 @@ ruleTester.run('named (export *)', rule, { context('TypeScript', function () { getTSParsers().forEach((parser) => { [ - 'typescript', - 'typescript-declare', - 'typescript-export-assign-namespace', + 'typescript', + 'typescript-declare', + 'typescript-export-assign-namespace', 'typescript-export-assign-namespace-merged', ].forEach((source) => { ruleTester.run(`named`, rule, { diff --git a/tests/src/rules/no-duplicates.js b/tests/src/rules/no-duplicates.js index 0137221b0..65ebc5665 100644 --- a/tests/src/rules/no-duplicates.js +++ b/tests/src/rules/no-duplicates.js @@ -306,7 +306,7 @@ ruleTester.run('no-duplicates', rule, { // Not autofix bail. output: ` import {x,y} from './foo' - + // some-tool-disable-next-line `, errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'], @@ -324,7 +324,7 @@ ruleTester.run('no-duplicates', rule, { import {x,y} from './foo' // comment - + `, errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'], }), diff --git a/utils/parse.js b/utils/parse.js index b3a469221..8f3104bf9 100644 --- a/utils/parse.js +++ b/utils/parse.js @@ -31,14 +31,14 @@ exports.default = function parse(path, content, context) { // provide the `filePath` like eslint itself does, in `parserOptions` // https://github.com/eslint/eslint/blob/3ec436ee/lib/linter.js#L637 parserOptions.filePath = path - + // @typescript-eslint/parser will parse the entire project with typechecking if you provide // "project" or "projects" in parserOptions. Removing these options means the parser will // only parse one file in isolate mode, which is much, much faster. // https://github.com/benmosher/eslint-plugin-import/issues/1408#issuecomment-509298962 delete parserOptions.project delete parserOptions.projects - + // require the parser relative to the main module (i.e., ESLint) const parser = moduleRequire(parserPath)