@blockquote/eslint-config 0.1.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 +84 -0
- package/package.json +99 -0
- package/src/base.d.ts +1290 -0
- package/src/base.js +23 -0
- package/src/config.d.ts +6 -0
- package/src/config.js +47 -0
- package/src/html.d.ts +44 -0
- package/src/html.js +39 -0
- package/src/ignores.d.ts +3 -0
- package/src/ignores.js +26 -0
- package/src/import-x.d.ts +27 -0
- package/src/import-x.js +68 -0
- package/src/index.d.ts +19 -0
- package/src/index.js +21 -0
- package/src/lit-a11y.d.ts +9 -0
- package/src/lit-a11y.js +21 -0
- package/src/lit.d.ts +12 -0
- package/src/lit.js +23 -0
- package/src/rules.d.ts +12 -0
- package/src/rules.js +14 -0
- package/src/test.d.ts +7 -0
- package/src/test.js +14 -0
- package/src/typescript.d.ts +16 -0
- package/src/typescript.js +52 -0
- package/src/wc.d.ts +8 -0
- package/src/wc.js +19 -0
package/src/base.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
|
|
4
|
+
export const fileTypes = '{js,ts,mjs}';
|
|
5
|
+
//
|
|
6
|
+
// ──────────────────────────────────────────────────────────────
|
|
7
|
+
// Base config
|
|
8
|
+
// ──────────────────────────────────────────────────────────────
|
|
9
|
+
//
|
|
10
|
+
export const baseConfig = [
|
|
11
|
+
js.configs.recommended,
|
|
12
|
+
{
|
|
13
|
+
languageOptions: {
|
|
14
|
+
ecmaVersion: 'latest',
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
globals: {
|
|
17
|
+
...globals.browser,
|
|
18
|
+
...globals.es2023,
|
|
19
|
+
...globals.mocha,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
package/src/config.d.ts
ADDED
package/src/config.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ignoresConfig } from './ignores.js';
|
|
2
|
+
import { baseConfig } from './base.js';
|
|
3
|
+
import {
|
|
4
|
+
createImportFilesConfig,
|
|
5
|
+
importFilesRules,
|
|
6
|
+
importSettingsConfig,
|
|
7
|
+
} from './import-x.js';
|
|
8
|
+
import { litA11yFilesConfig, litA11yFilesRules } from './lit-a11y.js';
|
|
9
|
+
import { wcFilesConfig, wcFilesRules } from './wc.js';
|
|
10
|
+
import { litFilesConfig, litFilesRules } from './lit.js';
|
|
11
|
+
import { createTsFilesConfig, tsFilesRules } from './typescript.js';
|
|
12
|
+
import {
|
|
13
|
+
htmlFilesConfig,
|
|
14
|
+
htmlFilesRules,
|
|
15
|
+
eslintPluginHtmlConfig,
|
|
16
|
+
} from './html.js';
|
|
17
|
+
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
18
|
+
import { globalRulesConfig } from './rules.js';
|
|
19
|
+
import { testFilesRules } from './test.js';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {{tsconfigRootDir?: string}} [options]
|
|
23
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
24
|
+
*/
|
|
25
|
+
export const createConfig = ({ tsconfigRootDir } = {}) => [
|
|
26
|
+
ignoresConfig,
|
|
27
|
+
...baseConfig,
|
|
28
|
+
...createImportFilesConfig(tsconfigRootDir),
|
|
29
|
+
importFilesRules,
|
|
30
|
+
importSettingsConfig,
|
|
31
|
+
litA11yFilesConfig,
|
|
32
|
+
litA11yFilesRules,
|
|
33
|
+
wcFilesConfig,
|
|
34
|
+
wcFilesRules,
|
|
35
|
+
litFilesConfig,
|
|
36
|
+
litFilesRules,
|
|
37
|
+
...createTsFilesConfig(tsconfigRootDir),
|
|
38
|
+
tsFilesRules,
|
|
39
|
+
htmlFilesConfig,
|
|
40
|
+
htmlFilesRules,
|
|
41
|
+
eslintPluginHtmlConfig,
|
|
42
|
+
testFilesRules,
|
|
43
|
+
globalRulesConfig,
|
|
44
|
+
eslintConfigPrettier,
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
export default createConfig;
|
package/src/html.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const htmlFilesConfig: {
|
|
2
|
+
files: string[];
|
|
3
|
+
plugins: {
|
|
4
|
+
'@html-eslint': typeof htmlEslint;
|
|
5
|
+
};
|
|
6
|
+
languageOptions: {
|
|
7
|
+
parser: typeof htmlEslintParser;
|
|
8
|
+
};
|
|
9
|
+
rules: Record<
|
|
10
|
+
string,
|
|
11
|
+
| 'error'
|
|
12
|
+
| [
|
|
13
|
+
'error',
|
|
14
|
+
{
|
|
15
|
+
inline: string[];
|
|
16
|
+
},
|
|
17
|
+
]
|
|
18
|
+
>;
|
|
19
|
+
};
|
|
20
|
+
export namespace htmlFilesRules {
|
|
21
|
+
let files: string[];
|
|
22
|
+
let rules: {
|
|
23
|
+
'@html-eslint/indent': string;
|
|
24
|
+
'@html-eslint/require-closing-tags': string;
|
|
25
|
+
'@html-eslint/no-extra-spacing-tags': string;
|
|
26
|
+
'@html-eslint/attrs-newline': string;
|
|
27
|
+
'@html-eslint/use-baseline': (
|
|
28
|
+
| string
|
|
29
|
+
| {
|
|
30
|
+
available: string;
|
|
31
|
+
}
|
|
32
|
+
)[];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export namespace eslintPluginHtmlConfig {
|
|
36
|
+
let files_1: string[];
|
|
37
|
+
export { files_1 as files };
|
|
38
|
+
export namespace plugins {
|
|
39
|
+
export { eslintPluginHtml };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
import htmlEslint from '@html-eslint/eslint-plugin';
|
|
43
|
+
import htmlEslintParser from '@html-eslint/parser';
|
|
44
|
+
import eslintPluginHtml from 'eslint-plugin-html';
|
package/src/html.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import htmlEslint from '@html-eslint/eslint-plugin';
|
|
2
|
+
import htmlEslintParser from '@html-eslint/parser';
|
|
3
|
+
import eslintPluginHtml from 'eslint-plugin-html';
|
|
4
|
+
//
|
|
5
|
+
// ──────────────────────────────────────────────────────────────
|
|
6
|
+
// HTML
|
|
7
|
+
// ──────────────────────────────────────────────────────────────
|
|
8
|
+
//
|
|
9
|
+
export const htmlFilesConfig = {
|
|
10
|
+
...htmlEslint.configs['flat/recommended'],
|
|
11
|
+
files: ['**/*.html'],
|
|
12
|
+
|
|
13
|
+
plugins: {
|
|
14
|
+
'@html-eslint': htmlEslint,
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
languageOptions: {
|
|
18
|
+
parser: htmlEslintParser,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const htmlFilesRules = {
|
|
23
|
+
files: ['**/*.html'],
|
|
24
|
+
|
|
25
|
+
rules: {
|
|
26
|
+
'@html-eslint/indent': 'off',
|
|
27
|
+
'@html-eslint/require-closing-tags': 'off',
|
|
28
|
+
'@html-eslint/no-extra-spacing-tags': 'off',
|
|
29
|
+
'@html-eslint/attrs-newline': 'off',
|
|
30
|
+
'@html-eslint/use-baseline': ['error', { available: 'newly' }],
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export const eslintPluginHtmlConfig = {
|
|
34
|
+
files: ['**/*.html'],
|
|
35
|
+
|
|
36
|
+
plugins: {
|
|
37
|
+
eslintPluginHtml,
|
|
38
|
+
},
|
|
39
|
+
};
|
package/src/ignores.d.ts
ADDED
package/src/ignores.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ──────────────────────────────────────────────────────────────
|
|
3
|
+
// ignores
|
|
4
|
+
// ──────────────────────────────────────────────────────────────
|
|
5
|
+
//
|
|
6
|
+
export const ignoresConfig = {
|
|
7
|
+
ignores: [
|
|
8
|
+
'**/.idea',
|
|
9
|
+
'**/.tmp',
|
|
10
|
+
'**/.vscode',
|
|
11
|
+
'**/.wireit',
|
|
12
|
+
'**/_site',
|
|
13
|
+
'**/build',
|
|
14
|
+
'**/coverage',
|
|
15
|
+
'**/dev',
|
|
16
|
+
'**/dist',
|
|
17
|
+
'**/reports',
|
|
18
|
+
'**/storybook-static',
|
|
19
|
+
'**/*screenshots*',
|
|
20
|
+
'**/*snapshots*',
|
|
21
|
+
'**/*.config.*',
|
|
22
|
+
'**/*.d.ts',
|
|
23
|
+
'**/*.min.js',
|
|
24
|
+
'**/*.workspace.*',
|
|
25
|
+
],
|
|
26
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function createImportFilesConfig(
|
|
2
|
+
tsconfigRootDir?: string,
|
|
3
|
+
): import('eslint').Linter.Config[];
|
|
4
|
+
export namespace importFilesRules {
|
|
5
|
+
let files: string[];
|
|
6
|
+
let rules: {
|
|
7
|
+
'import-x/extensions': (
|
|
8
|
+
| string
|
|
9
|
+
| {
|
|
10
|
+
ignorePackages: boolean;
|
|
11
|
+
}
|
|
12
|
+
)[];
|
|
13
|
+
'import-x/no-extraneous-dependencies': (
|
|
14
|
+
| string
|
|
15
|
+
| {
|
|
16
|
+
devDependencies: string[];
|
|
17
|
+
}
|
|
18
|
+
)[];
|
|
19
|
+
'import-x/no-unresolved': string;
|
|
20
|
+
'import-x/prefer-default-export': string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export namespace importSettingsConfig {
|
|
24
|
+
let settings: {
|
|
25
|
+
'import-x/resolver-next': import('eslint-plugin-import-x/node-resolver').NodeResolver[];
|
|
26
|
+
};
|
|
27
|
+
}
|
package/src/import-x.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
flatConfigs as importPlugin,
|
|
3
|
+
createNodeResolver,
|
|
4
|
+
} from 'eslint-plugin-import-x';
|
|
5
|
+
import { parser as tsParser } from 'typescript-eslint';
|
|
6
|
+
import { fileTypes } from './base.js';
|
|
7
|
+
//
|
|
8
|
+
// ──────────────────────────────────────────────────────────────
|
|
9
|
+
// eslint-plugin-import-x
|
|
10
|
+
// ──────────────────────────────────────────────────────────────
|
|
11
|
+
//
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} [tsconfigRootDir]
|
|
14
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
15
|
+
*/
|
|
16
|
+
export const createImportFilesConfig = (tsconfigRootDir) =>
|
|
17
|
+
[importPlugin.recommended, importPlugin.typescript].map((conf) => ({
|
|
18
|
+
...conf,
|
|
19
|
+
files: [`**/*.${fileTypes}`],
|
|
20
|
+
languageOptions: {
|
|
21
|
+
...conf.languageOptions,
|
|
22
|
+
parser: tsParser,
|
|
23
|
+
...(tsconfigRootDir && {
|
|
24
|
+
parserOptions: { tsconfigRootDir },
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
settings: {
|
|
28
|
+
...conf.settings,
|
|
29
|
+
'import-x/parsers': {},
|
|
30
|
+
'import-x/extensions': [
|
|
31
|
+
'.js',
|
|
32
|
+
'.mjs',
|
|
33
|
+
'.cjs',
|
|
34
|
+
'.ts',
|
|
35
|
+
'.tsx',
|
|
36
|
+
'.cts',
|
|
37
|
+
'.mts',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
}));
|
|
41
|
+
|
|
42
|
+
export const importFilesRules = {
|
|
43
|
+
files: [`**/*.${fileTypes}`],
|
|
44
|
+
rules: {
|
|
45
|
+
'import-x/extensions': ['error', 'always', { ignorePackages: true }],
|
|
46
|
+
'import-x/no-extraneous-dependencies': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
devDependencies: [
|
|
50
|
+
`**/demo/**/*.${fileTypes}`,
|
|
51
|
+
`**/test/**/*.${fileTypes}`,
|
|
52
|
+
`**/*.config.${fileTypes}`,
|
|
53
|
+
`**/*.conf.${fileTypes}`,
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
'import-x/no-unresolved': 'off',
|
|
58
|
+
'import-x/prefer-default-export': 'off',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const importSettingsConfig = {
|
|
63
|
+
settings: {
|
|
64
|
+
'import-x/resolver-next': [
|
|
65
|
+
createNodeResolver({ extensions: ['.js', '.ts'] }),
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
};
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { ignoresConfig } from './ignores.js';
|
|
2
|
+
export { baseConfig } from './base.js';
|
|
3
|
+
export { testFilesRules } from './test.js';
|
|
4
|
+
export { globalRulesConfig } from './rules.js';
|
|
5
|
+
export { default as createConfig, default } from './config.js';
|
|
6
|
+
export {
|
|
7
|
+
createImportFilesConfig,
|
|
8
|
+
importFilesRules,
|
|
9
|
+
importSettingsConfig,
|
|
10
|
+
} from './import-x.js';
|
|
11
|
+
export { litA11yFilesConfig, litA11yFilesRules } from './lit-a11y.js';
|
|
12
|
+
export { wcFilesConfig, wcFilesRules } from './wc.js';
|
|
13
|
+
export { litFilesConfig, litFilesRules } from './lit.js';
|
|
14
|
+
export { createTsFilesConfig, tsFilesRules } from './typescript.js';
|
|
15
|
+
export {
|
|
16
|
+
htmlFilesConfig,
|
|
17
|
+
htmlFilesRules,
|
|
18
|
+
eslintPluginHtmlConfig,
|
|
19
|
+
} from './html.js';
|
package/src/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { default as createConfig } from './config.js';
|
|
2
|
+
export { default } from './config.js';
|
|
3
|
+
|
|
4
|
+
export { ignoresConfig } from './ignores.js';
|
|
5
|
+
export { baseConfig } from './base.js';
|
|
6
|
+
export {
|
|
7
|
+
createImportFilesConfig,
|
|
8
|
+
importFilesRules,
|
|
9
|
+
importSettingsConfig,
|
|
10
|
+
} from './import-x.js';
|
|
11
|
+
export { litA11yFilesConfig, litA11yFilesRules } from './lit-a11y.js';
|
|
12
|
+
export { wcFilesConfig, wcFilesRules } from './wc.js';
|
|
13
|
+
export { litFilesConfig, litFilesRules } from './lit.js';
|
|
14
|
+
export { createTsFilesConfig, tsFilesRules } from './typescript.js';
|
|
15
|
+
export {
|
|
16
|
+
htmlFilesConfig,
|
|
17
|
+
htmlFilesRules,
|
|
18
|
+
eslintPluginHtmlConfig,
|
|
19
|
+
} from './html.js';
|
|
20
|
+
export { testFilesRules } from './test.js';
|
|
21
|
+
export { globalRulesConfig } from './rules.js';
|
package/src/lit-a11y.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as litA11y } from 'eslint-plugin-lit-a11y';
|
|
2
|
+
import { fileTypes } from './base.js';
|
|
3
|
+
//
|
|
4
|
+
// ──────────────────────────────────────────────────────────────
|
|
5
|
+
// eslint-plugin-lit-a11y
|
|
6
|
+
// ──────────────────────────────────────────────────────────────
|
|
7
|
+
//
|
|
8
|
+
export const litA11yFilesConfig = {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
...litA11y.configs.recommended,
|
|
11
|
+
files: [`**/*.${fileTypes}`],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const litA11yFilesRules = {
|
|
15
|
+
files: [`**/*.${fileTypes}`],
|
|
16
|
+
rules: {
|
|
17
|
+
'lit-a11y/no-autofocus': 'off',
|
|
18
|
+
'lit-a11y/anchor-is-valid': 'off',
|
|
19
|
+
'lit-a11y/click-events-have-key-events': 'off',
|
|
20
|
+
},
|
|
21
|
+
};
|
package/src/lit.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @type {import('eslint').Linter.Config} */
|
|
2
|
+
export const litFilesConfig: import('eslint').Linter.Config;
|
|
3
|
+
export namespace litFilesRules {
|
|
4
|
+
let files: string[];
|
|
5
|
+
let rules: {
|
|
6
|
+
'lit/lifecycle-super': string;
|
|
7
|
+
'lit/no-native-attributes': string;
|
|
8
|
+
'lit/no-useless-template-literals': string;
|
|
9
|
+
'lit/binding-positions': string;
|
|
10
|
+
'lit/no-invalid-html': string;
|
|
11
|
+
};
|
|
12
|
+
}
|
package/src/lit.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { configs as lit } from 'eslint-plugin-lit';
|
|
2
|
+
import { fileTypes } from './base.js';
|
|
3
|
+
//
|
|
4
|
+
// ──────────────────────────────────────────────────────────────
|
|
5
|
+
// eslint-plugin-lit
|
|
6
|
+
// ──────────────────────────────────────────────────────────────
|
|
7
|
+
//
|
|
8
|
+
/** @type {import('eslint').Linter.Config} */
|
|
9
|
+
export const litFilesConfig = {
|
|
10
|
+
...lit['flat/recommended'],
|
|
11
|
+
files: [`**/*.${fileTypes}`],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const litFilesRules = {
|
|
15
|
+
files: [`**/*.${fileTypes}`],
|
|
16
|
+
rules: {
|
|
17
|
+
'lit/lifecycle-super': 'error',
|
|
18
|
+
'lit/no-native-attributes': 'off',
|
|
19
|
+
'lit/no-useless-template-literals': 'off',
|
|
20
|
+
'lit/binding-positions': 'off',
|
|
21
|
+
'lit/no-invalid-html': 'off',
|
|
22
|
+
},
|
|
23
|
+
};
|
package/src/rules.d.ts
ADDED
package/src/rules.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ──────────────────────────────────────────────────────────────
|
|
3
|
+
// Global Rules
|
|
4
|
+
// ──────────────────────────────────────────────────────────────
|
|
5
|
+
//
|
|
6
|
+
export const globalRulesConfig = {
|
|
7
|
+
rules: {
|
|
8
|
+
'no-unused-expressions': [
|
|
9
|
+
'error',
|
|
10
|
+
{ allowShortCircuit: true, allowTernary: true },
|
|
11
|
+
],
|
|
12
|
+
'no-empty-function': 'error',
|
|
13
|
+
},
|
|
14
|
+
};
|
package/src/test.d.ts
ADDED
package/src/test.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { fileTypes } from './base.js';
|
|
2
|
+
//
|
|
3
|
+
// ──────────────────────────────────────────────────────────────
|
|
4
|
+
// Test Files
|
|
5
|
+
// ──────────────────────────────────────────────────────────────
|
|
6
|
+
//
|
|
7
|
+
export const testFilesRules = {
|
|
8
|
+
files: [`**/test/**/*.${fileTypes}`],
|
|
9
|
+
|
|
10
|
+
rules: {
|
|
11
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
12
|
+
'no-unused-expressions': 'off',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function createTsFilesConfig(
|
|
2
|
+
tsconfigRootDir?: string,
|
|
3
|
+
): import('eslint').Linter.Config[];
|
|
4
|
+
export namespace tsFilesRules {
|
|
5
|
+
let files: string[];
|
|
6
|
+
let rules: {
|
|
7
|
+
'@typescript-eslint/no-floating-promises': string;
|
|
8
|
+
'@typescript-eslint/ban-types': string;
|
|
9
|
+
'@typescript-eslint/explicit-function-return-type': string;
|
|
10
|
+
'@typescript-eslint/explicit-module-boundary-types': string;
|
|
11
|
+
'@typescript-eslint/no-empty-function': string;
|
|
12
|
+
'@typescript-eslint/no-non-null-assertion': string;
|
|
13
|
+
'@typescript-eslint/class-literal-property-style': string;
|
|
14
|
+
'@typescript-eslint/no-unused-expressions': string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { configs as tseslint } from 'typescript-eslint';
|
|
2
|
+
import { fileTypes } from './base.js';
|
|
3
|
+
//
|
|
4
|
+
// ──────────────────────────────────────────────────────────────
|
|
5
|
+
// typescript-eslint
|
|
6
|
+
// ──────────────────────────────────────────────────────────────
|
|
7
|
+
//
|
|
8
|
+
/**
|
|
9
|
+
* @param {string} [tsconfigRootDir]
|
|
10
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
11
|
+
*/
|
|
12
|
+
export const createTsFilesConfig = (tsconfigRootDir) =>
|
|
13
|
+
[...tseslint.strict, ...tseslint.stylistic].map((conf) => ({
|
|
14
|
+
...conf,
|
|
15
|
+
files: ['**/*.ts'],
|
|
16
|
+
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
...(conf.languageOptions && {
|
|
19
|
+
languageOptions: {
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
...conf.languageOptions,
|
|
22
|
+
|
|
23
|
+
parserOptions: {
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
...conf.languageOptions.parserOptions,
|
|
26
|
+
|
|
27
|
+
projectService: {
|
|
28
|
+
allowDefaultProject: [
|
|
29
|
+
`*.config.${fileTypes}`,
|
|
30
|
+
`*.conf.${fileTypes}`,
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
...(tsconfigRootDir && { tsconfigRootDir }),
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
export const tsFilesRules = {
|
|
41
|
+
files: ['**/*.ts'],
|
|
42
|
+
rules: {
|
|
43
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
44
|
+
'@typescript-eslint/ban-types': 'off',
|
|
45
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
46
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
47
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
48
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
49
|
+
'@typescript-eslint/class-literal-property-style': 'off',
|
|
50
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
51
|
+
},
|
|
52
|
+
};
|
package/src/wc.d.ts
ADDED
package/src/wc.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { configs as wc } from 'eslint-plugin-wc';
|
|
2
|
+
import { fileTypes } from './base.js';
|
|
3
|
+
//
|
|
4
|
+
// ──────────────────────────────────────────────────────────────
|
|
5
|
+
// eslint-plugin-wc
|
|
6
|
+
// ──────────────────────────────────────────────────────────────
|
|
7
|
+
//
|
|
8
|
+
/** @type {import('eslint').Linter.Config} */
|
|
9
|
+
export const wcFilesConfig = {
|
|
10
|
+
...wc['flat/recommended'],
|
|
11
|
+
files: [`**/*.${fileTypes}`],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const wcFilesRules = {
|
|
15
|
+
files: [`**/*.${fileTypes}`],
|
|
16
|
+
rules: {
|
|
17
|
+
'wc/no-constructor-attributes': 'warn',
|
|
18
|
+
},
|
|
19
|
+
};
|