eslint-config-decent 1.6.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -13
- package/dist/index.cjs +4 -0
- package/dist/index.d.cts +14 -3
- package/dist/index.d.mts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
- package/src/index.ts +15 -0
package/README.md
CHANGED
|
@@ -9,40 +9,55 @@ A decent ESLint configuration for TypeScript projects.
|
|
|
9
9
|
```mjs
|
|
10
10
|
// eslint.config.mjs
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import tsEslint from 'typescript-eslint';
|
|
12
|
+
import { config } from 'eslint-config-decent';
|
|
14
13
|
|
|
15
|
-
export default
|
|
14
|
+
export default config();
|
|
16
15
|
```
|
|
17
16
|
|
|
18
17
|
## Override parserOptions
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
```mjs
|
|
21
20
|
// eslint.config.mjs
|
|
22
21
|
|
|
23
|
-
import {
|
|
24
|
-
import tsEslint from 'typescript-eslint';
|
|
22
|
+
import { config } from 'eslint-config-decent';
|
|
25
23
|
|
|
26
|
-
export default
|
|
24
|
+
export default config({
|
|
27
25
|
projectService: {
|
|
28
26
|
allowDefaultProject: ['./*.{js,cjs,mjs}'],
|
|
29
27
|
defaultProject: 'tsconfig.json',
|
|
30
28
|
},
|
|
31
29
|
tsconfigRootDir: import.meta.dirname,
|
|
32
|
-
})
|
|
30
|
+
});
|
|
31
|
+
```
|
|
33
32
|
|
|
34
33
|
## Disable require-extensions rules
|
|
35
34
|
|
|
36
35
|
```mjs
|
|
37
36
|
// eslint.config.mjs
|
|
38
37
|
|
|
39
|
-
import {
|
|
40
|
-
import tsEslint from 'typescript-eslint';
|
|
38
|
+
import { config } from 'eslint-config-decent';
|
|
41
39
|
|
|
42
|
-
export default
|
|
40
|
+
export default config({
|
|
43
41
|
enableRequireExtensions: false,
|
|
44
|
-
})
|
|
45
|
-
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Override a rule
|
|
46
|
+
|
|
47
|
+
```mjs
|
|
48
|
+
// eslint.config.mjs
|
|
49
|
+
|
|
50
|
+
import { config } from 'eslint-config-decent';
|
|
51
|
+
|
|
52
|
+
export default [
|
|
53
|
+
...config(),
|
|
54
|
+
{
|
|
55
|
+
files: ['**/*.ts'],
|
|
56
|
+
rules: {
|
|
57
|
+
'@typescript-eslint/no-confusing-void-expression': 'off',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
```
|
|
46
61
|
|
|
47
62
|
## License
|
|
48
63
|
|
package/dist/index.cjs
CHANGED
|
@@ -765,7 +765,11 @@ function defaultConfig(options) {
|
|
|
765
765
|
prettier__default
|
|
766
766
|
];
|
|
767
767
|
}
|
|
768
|
+
function config(options) {
|
|
769
|
+
return tsEslint__default.config(...defaultConfig(options));
|
|
770
|
+
}
|
|
768
771
|
|
|
772
|
+
exports.config = config;
|
|
769
773
|
exports.defaultConfig = defaultConfig;
|
|
770
774
|
exports.eslintConfigs = configs$9;
|
|
771
775
|
exports.importConfigs = configs$7;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigWithExtends } from 'typescript-eslint';
|
|
2
1
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
import { ConfigWithExtends } from 'typescript-eslint';
|
|
3
3
|
|
|
4
4
|
declare const configs$7: {
|
|
5
5
|
base: TSESLint.FlatConfig.Config;
|
|
@@ -39,6 +39,17 @@ interface DefaultConfigOptions {
|
|
|
39
39
|
parserOptions?: NonNullable<ConfigWithExtends['languageOptions']>['parserOptions'];
|
|
40
40
|
enableRequireExtensionRule?: boolean;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Exports the default configuration to be passed to `tsEslint.config`. Use this if you want more control of typescript-eslint configuration output.
|
|
44
|
+
* @param {DefaultConfigOptions} options
|
|
45
|
+
* @returns Array of typescript-eslint configurations
|
|
46
|
+
*/
|
|
42
47
|
declare function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends[];
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Exports eslint configurations. Use this if you do not need to explicitly import typescript-eslint in your project.
|
|
50
|
+
* @param options
|
|
51
|
+
* @returns An array of eslint configurations
|
|
52
|
+
*/
|
|
53
|
+
declare function config(options?: DefaultConfigOptions): TSESLint.FlatConfig.ConfigArray;
|
|
54
|
+
|
|
55
|
+
export { type DefaultConfigOptions, config, defaultConfig, configs$7 as eslintConfigs, configs$6 as importConfigs, configs$5 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigWithExtends } from 'typescript-eslint';
|
|
2
1
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
import { ConfigWithExtends } from 'typescript-eslint';
|
|
3
3
|
|
|
4
4
|
declare const configs$7: {
|
|
5
5
|
base: TSESLint.FlatConfig.Config;
|
|
@@ -39,6 +39,17 @@ interface DefaultConfigOptions {
|
|
|
39
39
|
parserOptions?: NonNullable<ConfigWithExtends['languageOptions']>['parserOptions'];
|
|
40
40
|
enableRequireExtensionRule?: boolean;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Exports the default configuration to be passed to `tsEslint.config`. Use this if you want more control of typescript-eslint configuration output.
|
|
44
|
+
* @param {DefaultConfigOptions} options
|
|
45
|
+
* @returns Array of typescript-eslint configurations
|
|
46
|
+
*/
|
|
42
47
|
declare function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends[];
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Exports eslint configurations. Use this if you do not need to explicitly import typescript-eslint in your project.
|
|
50
|
+
* @param options
|
|
51
|
+
* @returns An array of eslint configurations
|
|
52
|
+
*/
|
|
53
|
+
declare function config(options?: DefaultConfigOptions): TSESLint.FlatConfig.ConfigArray;
|
|
54
|
+
|
|
55
|
+
export { type DefaultConfigOptions, config, defaultConfig, configs$7 as eslintConfigs, configs$6 as importConfigs, configs$5 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigWithExtends } from 'typescript-eslint';
|
|
2
1
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
import { ConfigWithExtends } from 'typescript-eslint';
|
|
3
3
|
|
|
4
4
|
declare const configs$7: {
|
|
5
5
|
base: TSESLint.FlatConfig.Config;
|
|
@@ -39,6 +39,17 @@ interface DefaultConfigOptions {
|
|
|
39
39
|
parserOptions?: NonNullable<ConfigWithExtends['languageOptions']>['parserOptions'];
|
|
40
40
|
enableRequireExtensionRule?: boolean;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Exports the default configuration to be passed to `tsEslint.config`. Use this if you want more control of typescript-eslint configuration output.
|
|
44
|
+
* @param {DefaultConfigOptions} options
|
|
45
|
+
* @returns Array of typescript-eslint configurations
|
|
46
|
+
*/
|
|
42
47
|
declare function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends[];
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Exports eslint configurations. Use this if you do not need to explicitly import typescript-eslint in your project.
|
|
50
|
+
* @param options
|
|
51
|
+
* @returns An array of eslint configurations
|
|
52
|
+
*/
|
|
53
|
+
declare function config(options?: DefaultConfigOptions): TSESLint.FlatConfig.ConfigArray;
|
|
54
|
+
|
|
55
|
+
export { type DefaultConfigOptions, config, defaultConfig, configs$7 as eslintConfigs, configs$6 as importConfigs, configs$5 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
|
package/dist/index.mjs
CHANGED
|
@@ -746,5 +746,8 @@ function defaultConfig(options) {
|
|
|
746
746
|
prettier
|
|
747
747
|
];
|
|
748
748
|
}
|
|
749
|
+
function config(options) {
|
|
750
|
+
return tsEslint.config(...defaultConfig(options));
|
|
751
|
+
}
|
|
749
752
|
|
|
750
|
-
export { defaultConfig, configs$9 as eslintConfigs, configs$7 as importConfigs, configs$6 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
|
|
753
|
+
export { config, defaultConfig, configs$9 as eslintConfigs, configs$7 as importConfigs, configs$6 as jsdocConfigs, configs$4 as promiseConfigs, configs$3 as reactConfigs, configs$2 as securityConfigs, configs$1 as typescriptEslintConfigs, configs as unicornConfigs };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import eslint from '@eslint/js';
|
|
2
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
3
|
import prettier from 'eslint-plugin-prettier/recommended';
|
|
3
4
|
import globals from 'globals';
|
|
4
5
|
import tsEslint, { type ConfigWithExtends } from 'typescript-eslint';
|
|
@@ -30,6 +31,11 @@ export interface DefaultConfigOptions {
|
|
|
30
31
|
enableRequireExtensionRule?: boolean;
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Exports the default configuration to be passed to `tsEslint.config`. Use this if you want more control of typescript-eslint configuration output.
|
|
36
|
+
* @param {DefaultConfigOptions} options
|
|
37
|
+
* @returns Array of typescript-eslint configurations
|
|
38
|
+
*/
|
|
33
39
|
export function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends[] {
|
|
34
40
|
const enableRequireExtensionRule = options?.enableRequireExtensionRule ?? true;
|
|
35
41
|
const languageOptions: ConfigWithExtends['languageOptions'] = {
|
|
@@ -127,3 +133,12 @@ export function defaultConfig(options?: DefaultConfigOptions): ConfigWithExtends
|
|
|
127
133
|
prettier,
|
|
128
134
|
];
|
|
129
135
|
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Exports eslint configurations. Use this if you do not need to explicitly import typescript-eslint in your project.
|
|
139
|
+
* @param options
|
|
140
|
+
* @returns An array of eslint configurations
|
|
141
|
+
*/
|
|
142
|
+
export function config(options?: DefaultConfigOptions): TSESLint.FlatConfig.ConfigArray {
|
|
143
|
+
return tsEslint.config(...defaultConfig(options));
|
|
144
|
+
}
|