-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy patheslint.config.js
85 lines (83 loc) · 2.25 KB
/
eslint.config.js
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// @ts-nocheck
import { includeIgnoreFile } from '@eslint/compat';
import nodePlugin from 'eslint-plugin-n';
import globals from 'globals';
import path from 'node:path';
import i18nPlugin from './eslint/i18n/eslint-plugin-i18n.js';
import cleverCloudEsm from './eslint/javascript/eslint-config-clever-cloud-esm.js';
import litA11yCleverCloud from './eslint/lit-a11y/eslint-config-lit-a11y-clever-cloud.js';
import litCleverCloud from './eslint/lit/eslint-config-lit-clever-cloud.js';
import wcCleverCloud from './eslint/wc/eslint-config-wc-clever-cloud.js';
const gitignorePath = path.resolve('./', '.gitignore');
export default [
// common ignores
includeIgnoreFile(gitignorePath),
{
name: 'project-ignores',
ignores: ['docs/**/*', '**/*.d.ts', 'src/assets/**/*'],
},
cleverCloudEsm,
i18nPlugin.configs.recommended,
wcCleverCloud,
litCleverCloud,
litA11yCleverCloud,
// Allow importing dev dependencies for files that are related to build / stories / tooling / testing
{
name: 'allow-extraneous-imports',
files: [
'**/*.test.js',
'test/**/*.*js',
'test-mocha/**/*.*js',
'src/stories/**/*.js',
'eslint.config.js',
'eslint/**/*.*js',
'tasks/**/*.js',
'rollup/**/*.js',
'cem/**/*.js',
'web-test-runner.config.js',
'wds/**/*.js',
'.storybook/**/*.js',
],
rules: {
'import/no-extraneous-dependencies': [
'off',
{ devDependencies: true, optionalDependencies: false, peerDependencies: false },
],
},
},
{
name: 'mocha-context',
files: ['**/*.test.*js', 'test/**/*.js', 'test-mocha/**/*.js'],
languageOptions: {
globals: {
...globals.mocha,
},
},
},
{
name: 'node-esm-context',
files: [
'tasks/**/*.js',
'rollup/**/*.js',
'cem/**/*.js',
'web-test-runner.config.js',
'wds/**/*.js',
'src/stories/lib/smart-auth-plugin.js',
'test-mocha/**/*.*js',
'.storybook/**/*.js',
],
languageOptions: {
globals: {
...globals.node,
},
},
plugins: {
n: nodePlugin,
},
rules: {
...nodePlugin.configs['flat/recommended-script'].rules,
'n/no-process-exit': 'off',
'n/no-extraneous-import': 'off',
},
},
];