-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
54 lines (48 loc) · 1.41 KB
/
.eslintrc.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
const path = require('path');
const cjsGlobals = ['__dirname', '__filename', 'require', 'module', 'exports'];
const flowPackages = ['حزم/{لب,خرائط-الترجمة}/**/*.js'];
const configs = [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
// 'plugin:prettier/recommended',
'prettier'
];
const plugins = ['import', 'prettier'];
module.exports = {
root: true,
env: { es2021: true, node: true },
extends: configs,
plugins,
overrides: [
{
files: flowPackages,
parser: '@babel/eslint-parser', // to enable flowjs syntax to be parsed
parserOptions: {
sourceType: 'module'
},
plugins: ['flowtype', ...plugins],
extends: ['plugin:flowtype/recommended', ...configs],
rules: { 'no-restricted-globals': ['error', ...cjsGlobals] },
settings: {
flowtype: { onlyFilesWithFlowAnnotation: false }
}
},
{
// the same used in babel monorepo
files: ['حزم/محلل/**/*.js'],
plugins: ['@babel/development-internal'],
extends: '@babel/internal',
rules: {
// prettier-ignore
'@babel/development-internal/dry-error-messages': ['error', {
errorModule: path.resolve(__dirname, 'حزم/محلل/مصدر/parser/error.js')
}]
}
},
{
files: ['حزم/ترجم/مصدر/{استدعي,مدخل}.js'],
rules: { 'no-undef': 0 }
}
]
};