-
Notifications
You must be signed in to change notification settings - Fork 67
/
.eslintignore.js
38 lines (37 loc) · 1.13 KB
/
.eslintignore.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
module.exports = {
getIgnoredPatterns,
};
/**
* Patterns defined in .eslintignore take precedence over the ignorePatterns property of config files (https://eslint.org/docs/latest/use/configure/ignore)
* We need to maintain it in a file because it's more convenient.
* But the ".eslintignore" file needs to be renamed, so that it doesn't interfere with this config.
* @param isCI
* @param isLintStaged
* @param isLintScript
* @returns {string[]}
*/
function getIgnoredPatterns({ isCI, isLintStaged, isLintScript }) {
let ignored = [
'!.*.js',
'build',
'node_modules',
'templates',
'next-demo',
'server/helpers/getFilterPredicate.js',
];
if (isCI || isLintStaged) {
// ignore in CI
// still show any errors in IDE & in local running eslint script
}
if (isCI || isLintStaged || isLintScript) {
// ignore in CI & for local running eslint script
// still show any errors in IDE
ignored = ignored.concat([
'uui-db',
'extra',
'draft-rte',
'uui-timeline',
]);
}
return ignored;
}