-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy patheslint.config.js
More file actions
59 lines (54 loc) · 1.45 KB
/
eslint.config.js
File metadata and controls
59 lines (54 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { fileURLToPath } from 'node:url';
import { defineConfig as defineVnphanquangConfig } from '@vnphanquang/eslint-config';
import { defineConfig as defineEslintConfig, globalIgnores } from 'eslint/config';
import jsdoc from 'eslint-plugin-jsdoc';
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
const jsdocConfig = [
{
files: ['libs/**/*.js'],
...jsdoc.configs['flat/recommended-typescript-flavor'],
},
{
files: ['**/*.js'],
plugins: {
jsdoc,
},
rules: {
'jsdoc/require-returns-description': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-jsdoc': [
'warn',
{
publicOnly: {
ancestorsOnly: true,
},
},
],
},
},
];
/**
* @param {import('@sveltejs/kit').Config | true} [svelteConfig]
* @param {import('eslint').Linter.Config[]} [additionals]
* @returns {Promise<import('eslint').Linter.Config>}
*/
export async function defineConfig(svelteConfig, additionals = []) {
return defineEslintConfig([
globalIgnores(['**/*.md.svelte', '**/generated/*.js', '**/__snapshots__/**.js']),
...jsdocConfig,
...(await defineVnphanquangConfig({
gitignorePath,
...(svelteConfig
? { svelte: typeof svelteConfig === 'boolean' ? true : { config: svelteConfig } }
: {}),
})),
...additionals,
{
rules: {
// FIXME: reconsolidate and support this rule
'svelte/no-navigation-without-resolve': 'off',
},
},
]);
}
export default defineConfig(true);