forked from RedHatInsights/frontend-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
49 lines (48 loc) · 1.55 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
const path = require('path');
const rulesDirPlugin = require('eslint-plugin-rulesdir');
rulesDirPlugin.RULES_DIR = path.resolve(__dirname, './packages/eslint-config/lib/rules');
module.exports = {
plugins: ['rulesdir', 'import'],
extends: path.resolve(__dirname, './packages/eslint-config/index.js'),
globals: {
insights: 'readonly',
},
rules: {
'no-prototype-builtins': 'off',
'import/prefer-default-export': ['error'],
'sort-imports': [
2,
{
ignoreDeclarationSort: true,
},
],
'react/no-unknown-property': ['error', { ignore: ['widget-type', 'widget-id', 'page-type', 'ouiaId'] }],
'rulesdir/forbid-pf-relative-imports': 1,
},
overrides: [
{
files: ['packages/**/src/**/*.ts', 'packages/**/src/**/*.tsx', 'packages/types/*.ts'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'react/prop-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }],
},
},
{
files: [
'packages/pdf-generator/src/**/*.js',
'packages/**/src/**/*__mock__*/**/*.js',
'packages/**/src/**/*__mocks__*/**/*.js',
'packages/create-crc-app/**/*.js',
],
rules: {
'import/prefer-default-export': 'off',
},
},
],
};