Skip to content

Commit

Permalink
[meta] remove trailing whitespaces; ensure trailing file newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 9, 2020
1 parent 13aa29c commit 00a9ad9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
repo_token: fW3moW39Z8pKOgqTnUMT68DnNCd2SM8Ly
repo_token: fW3moW39Z8pKOgqTnUMT68DnNCd2SM8Ly
12 changes: 6 additions & 6 deletions docs/rules/no-unused-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -27,24 +27,24 @@ 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) }
```

#### 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 }
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/src/rules/named.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
4 changes: 2 additions & 2 deletions tests/src/rules/no-duplicates.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.'],
Expand All @@ -324,7 +324,7 @@ ruleTester.run('no-duplicates', rule, {
import {x,y} from './foo'
// comment
`,
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
}),
Expand Down
4 changes: 2 additions & 2 deletions utils/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 00a9ad9

Please sign in to comment.