-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy patheslint.config.js
More file actions
80 lines (73 loc) · 1.96 KB
/
eslint.config.js
File metadata and controls
80 lines (73 loc) · 1.96 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
* @license Copyright (c) 2020-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/
import { readdirSync } from 'node:fs';
import globals from 'globals';
import { defineConfig } from 'eslint/config';
import eslintConfigCKEditor5 from 'eslint-config-ckeditor5';
import eslintPluginCKEditor5Rules from 'eslint-plugin-ckeditor5-rules';
const projectPackages = readdirSync( './packages', { withFileTypes: true } )
.filter( dirent => dirent.isDirectory() )
.map( dirent => dirent.name );
export default defineConfig( [
eslintConfigCKEditor5,
{
name: 'Ignored files config',
ignores: [
'coverage/**',
'packages/ckeditor5-package-generator/lib/templates/common/CLAUDE.md' // Symlink.
]
},
{
name: 'Base config',
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.node
}
},
linterOptions: {
reportUnusedInlineConfigs: 'error',
reportUnusedDisableDirectives: 'error'
},
plugins: {
'ckeditor5-rules': eslintPluginCKEditor5Rules
},
files: [ '**/*.{js,cjs,mjs,ts}' ],
rules: {
'no-console': 'off',
'ckeditor5-rules/license-header': [ 'error', { headerLines: [
'/**',
' * @license Copyright (c) 2020-2026, CKSource Holding sp. z o.o. All rights reserved.',
' * For licensing, see LICENSE.md.',
' */'
] } ],
'ckeditor5-rules/require-file-extensions-in-imports': [ 'error', {
extensions: [ '.ts', '.js', '.json' ]
} ]
}
},
{
name: 'Templates config',
files: [ './packages/ckeditor5-package-generator/lib/templates/**/*.{js,cjs,ts}' ],
rules: {
'ckeditor5-rules/license-header': 'off'
}
},
// Rules specific to changelog files.
{
extends: eslintConfigCKEditor5,
files: [ '.changelog/**/*.md' ],
plugins: {
'ckeditor5-rules': eslintPluginCKEditor5Rules
},
rules: {
'ckeditor5-rules/validate-changelog-entry': [ 'error', {
allowedScopes: projectPackages,
repositoryType: 'mono'
} ]
}
}
] );