Skip to content

Commit dc2fac7

Browse files
feat: exclude option (#41)
* feat: exclude option * style: formatting * chore: update deps * docs: fix option files * fix: default values * chore: order options * test: add test for exclude option * test: increase coverage
1 parent 5264551 commit dc2fac7

16 files changed

+1305
-1588
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,28 @@ A string indicating the root of your files.
113113

114114
Path to `eslint` instance that will be used for linting. If the `eslintPath` is a folder like a official eslint, or specify a `formatter` option. now you dont have to install `eslint`.
115115

116-
### `files`
116+
### `extensions`
117117

118118
- Type: `String|Array[String]`
119-
- Default: `'.'`
119+
- Default: `'js'`
120120

121-
Specify directories, files, or globs. Must be relative to `options.context`.
122-
Directories are traveresed recursively looking for files matching `options.extensions`.
123-
File and glob patterns ignore `options.extensions`.
121+
Specify extensions that should be checked.
124122

125-
### `extensions`
123+
### `exclude`
126124

127125
- Type: `String|Array[String]`
128-
- Default: `'js'`
126+
- Default: `'node_modules'`
129127

130-
Specify extensions that should be checked.
128+
Specify the files and/or directories to exclude. Must be relative to `options.context`.
129+
130+
### `files`
131+
132+
- Type: `String|Array[String]`
133+
- Default: `null`
134+
135+
Specify directories, files, or globs. Must be relative to `options.context`.
136+
Directories are traveresed recursively looking for files matching `options.extensions`.
137+
File and glob patterns ignore `options.extensions`.
131138

132139
### `fix`
133140

declarations/getESLint.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ export type Options = {
1616
emitError?: boolean | undefined;
1717
emitWarning?: boolean | undefined;
1818
eslintPath?: string | undefined;
19+
exclude?: string | string[] | undefined;
20+
extensions?: string | string[] | undefined;
1921
failOnError?: boolean | undefined;
2022
failOnWarning?: boolean | undefined;
2123
files?: string | string[] | undefined;
22-
extensions?: string | string[] | undefined;
2324
fix?: boolean | undefined;
2425
formatter?: string | import('./options').FormatterFunction | undefined;
2526
lintDirtyModulesOnly?: boolean | undefined;

declarations/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ export type Options = {
55
emitError?: boolean | undefined;
66
emitWarning?: boolean | undefined;
77
eslintPath?: string | undefined;
8+
exclude?: string | string[] | undefined;
9+
extensions?: string | string[] | undefined;
810
failOnError?: boolean | undefined;
911
failOnWarning?: boolean | undefined;
1012
files?: string | string[] | undefined;
11-
extensions?: string | string[] | undefined;
1213
fix?: boolean | undefined;
1314
formatter?: string | import('./options').FormatterFunction | undefined;
1415
lintDirtyModulesOnly?: boolean | undefined;

declarations/linter.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ export type Options = {
3131
emitError?: boolean | undefined;
3232
emitWarning?: boolean | undefined;
3333
eslintPath?: string | undefined;
34+
exclude?: string | string[] | undefined;
35+
extensions?: string | string[] | undefined;
3436
failOnError?: boolean | undefined;
3537
failOnWarning?: boolean | undefined;
3638
files?: string | string[] | undefined;
37-
extensions?: string | string[] | undefined;
3839
fix?: boolean | undefined;
3940
formatter?: string | import('./options').FormatterFunction | undefined;
4041
lintDirtyModulesOnly?: boolean | undefined;

declarations/options.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
* @property {boolean=} emitError
1919
* @property {boolean=} emitWarning
2020
* @property {string=} eslintPath
21+
* @property {string|string[]=} exclude
22+
* @property {string|string[]=} extensions
2123
* @property {boolean=} failOnError
2224
* @property {boolean=} failOnWarning
2325
* @property {string|string[]=} files
24-
* @property {string|string[]=} extensions
2526
* @property {boolean=} fix
2627
* @property {string|FormatterFunction=} formatter
2728
* @property {boolean=} lintDirtyModulesOnly
@@ -54,10 +55,11 @@ export type Options = {
5455
emitError?: boolean | undefined;
5556
emitWarning?: boolean | undefined;
5657
eslintPath?: string | undefined;
58+
exclude?: (string | string[]) | undefined;
59+
extensions?: (string | string[]) | undefined;
5760
failOnError?: boolean | undefined;
5861
failOnWarning?: boolean | undefined;
5962
files?: (string | string[]) | undefined;
60-
extensions?: (string | string[]) | undefined;
6163
fix?: boolean | undefined;
6264
formatter?: (string | FormatterFunction) | undefined;
6365
lintDirtyModulesOnly?: boolean | undefined;

0 commit comments

Comments
 (0)