forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.changed.js
53 lines (53 loc) · 2.1 KB
/
.eslintrc.changed.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
module.exports = {
plugins: ['@typescript-eslint', 'deprecation'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
rules: {
'deprecation/deprecation': 'error',
'rulesdir/no-default-id-values': 'error',
'no-restricted-syntax': [
'error',
{
selector: 'ImportNamespaceSpecifier[parent.source.value=/^@libs/]',
message: 'Namespace imports from @libs are not allowed. Use named imports instead. Example: import { method } from "@libs/module"',
},
{
selector: 'ImportNamespaceSpecifier[parent.source.value=/^@userActions/]',
message: 'Namespace imports from @userActions are not allowed. Use named imports instead. Example: import { action } from "@userActions/module"',
},
],
},
overrides: [
{
files: [
'src/libs/actions/IOU.ts',
'src/libs/actions/Report.ts',
'src/libs/OptionsListUtils.ts',
'src/pages/home/ReportScreen.tsx',
'src/pages/workspace/WorkspaceInitialPage.tsx',
'src/pages/home/report/PureReportActionItem.tsx',
],
rules: {
'rulesdir/no-default-id-values': 'off',
},
},
{
files: ['**/libs/**/*.{ts,tsx}'],
rules: {
'no-restricted-syntax': [
'error',
{
selector: 'ImportNamespaceSpecifier[parent.source.value=/^\\.\\./]',
message: 'Namespace imports are not allowed. Use named imports instead. Example: import { method } from "../libs/module"',
},
{
selector: 'ImportNamespaceSpecifier[parent.source.value=/^\\./]',
message: 'Namespace imports are not allowed. Use named imports instead. Example: import { method } from "./libs/module"',
},
],
},
},
],
};