Skip to content

Commit 615af45

Browse files
ci: bump eslint
1 parent 2b1b28c commit 615af45

File tree

4 files changed

+559
-394
lines changed

4 files changed

+559
-394
lines changed

.eslintrc.js

Lines changed: 100 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,104 @@
11
module.exports = {
2-
'parser': '@typescript-eslint/parser',
3-
'plugins': ['@typescript-eslint', 'mocha'],
4-
'env': {
5-
'es6': true,
6-
'node': true,
7-
'mocha': true,
8-
},
9-
'extends': [
10-
'airbnb',
11-
'plugin:@typescript-eslint/recommended',
12-
'plugin:mocha/recommended'
2+
parser: '@typescript-eslint/parser',
3+
plugins: ['@typescript-eslint', 'mocha'],
4+
env: {
5+
es6: true,
6+
node: true,
7+
mocha: true,
8+
},
9+
extends: [
10+
'airbnb',
11+
'plugin:@typescript-eslint/recommended',
12+
'plugin:mocha/recommended',
13+
],
14+
parserOptions: {
15+
ecmaVersion: 2018,
16+
sourceType: 'module',
17+
},
18+
rules: {
19+
'react/jsx-filename-extension': 'off',
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
indent: [
22+
'error',
23+
2,
1324
],
14-
'parserOptions': {
15-
'ecmaVersion': 2018,
16-
'sourceType': 'module'
17-
},
18-
'rules': {
19-
"react/jsx-filename-extension": 'off',
20-
'@typescript-eslint/no-explicit-any': 'off',
21-
'indent': [
22-
'error',
23-
2
24-
],
25-
'import/prefer-default-export': 'off',
26-
'linebreak-style': ['error', 'unix'],
27-
'quotes': ['error', 'single'],
28-
'semi': ['error', 'never'],
29-
'import/no-unresolved': 'off',
25+
'import/prefer-default-export': 'off',
26+
'linebreak-style': ['error', 'unix'],
27+
quotes: ['error', 'single'],
28+
semi: ['error', 'never'],
29+
'import/no-unresolved': 'off',
30+
'func-names': 'off',
31+
'no-underscore-dangle': 'off',
32+
'guard-for-in': 'off',
33+
'no-restricted-syntax': 'off',
34+
'no-await-in-loop': 'off',
35+
'object-curly-newline': 'off',
36+
'import/extensions': 'off',
37+
'mocha/no-hooks-for-single-case': 'off',
38+
'no-param-reassign': 'off',
39+
},
40+
ignorePatterns: [
41+
'*/build/**/*',
42+
'*.json',
43+
'*.txt',
44+
'*.md',
45+
'*.lock',
46+
'*.log',
47+
'*.yaml',
48+
'**/*/frontend/assets/**/*',
49+
'*.d.ts',
50+
],
51+
overrides: [
52+
{
53+
files: [
54+
'*-test.js',
55+
'*.spec.js',
56+
'*-test.ts',
57+
'*.spec.ts',
58+
'*.spec.tsx',
59+
'*.factory.ts',
60+
'*.factory.js',
61+
],
62+
rules: {
63+
'no-unused-expressions': 'off',
3064
'func-names': 'off',
31-
'no-underscore-dangle': 'off',
32-
'guard-for-in': 'off',
33-
'no-restricted-syntax': 'off',
34-
'no-await-in-loop': 'off',
35-
'object-curly-newline': 'off',
36-
'import/extensions': 'off',
37-
'mocha/no-hooks-for-single-case': 'off',
38-
'no-param-reassign': 'off',
65+
'prefer-arrow-callback': 'off',
66+
'import/no-extraneous-dependencies': 'off',
67+
'mocha/no-mocha-arrows': 'off',
68+
'@typescript-eslint/explicit-function-return-type': 'off',
69+
},
3970
},
40-
overrides: [
41-
{
42-
files: [
43-
'*-test.js',
44-
'*.spec.js',
45-
'*-test.ts',
46-
'*.spec.ts',
47-
'*.spec.tsx',
48-
'*.factory.ts',
49-
'*.factory.js'
50-
],
51-
rules: {
52-
'no-unused-expressions': 'off',
53-
'func-names': 'off',
54-
'prefer-arrow-callback': 'off',
55-
'import/no-extraneous-dependencies': 'off',
56-
'mocha/no-mocha-arrows': 'off',
57-
'@typescript-eslint/explicit-function-return-type': 'off',
58-
},
59-
},
60-
{
61-
files: ['*.jsx', '*.js'],
62-
rules: {
63-
"@typescript-eslint/explicit-function-return-type": 'off'
64-
}
65-
},
66-
{
67-
files: ['*.tsx'],
68-
rules: {
69-
"react/prop-types": 'off'
70-
}
71-
},
72-
{
73-
files: ['**/*/cypress/integration/**/*.spec.js'],
74-
rules: {
75-
'mocha/no-mocha-arrows': 'off',
76-
'spaced-comment': 'off'
77-
}
78-
},
79-
],
80-
globals: {
81-
'expect': true,
82-
'factory': true,
83-
'sandbox': true,
84-
'server': true,
85-
'window': true,
86-
'AdminBro': true,
87-
'flatpickr': true,
88-
'FormData': true,
89-
'File': true,
90-
'cy': true,
91-
'Cypress': true,
92-
}
93-
}
71+
{
72+
files: ['*.jsx', '*.js'],
73+
rules: {
74+
'@typescript-eslint/explicit-function-return-type': 'off',
75+
},
76+
},
77+
{
78+
files: ['*.tsx'],
79+
rules: {
80+
'react/prop-types': 'off',
81+
},
82+
},
83+
{
84+
files: ['**/*/cypress/integration/**/*.spec.js'],
85+
rules: {
86+
'mocha/no-mocha-arrows': 'off',
87+
'spaced-comment': 'off',
88+
},
89+
},
90+
],
91+
globals: {
92+
expect: true,
93+
factory: true,
94+
sandbox: true,
95+
server: true,
96+
window: true,
97+
AdminBro: true,
98+
flatpickr: true,
99+
FormData: true,
100+
File: true,
101+
cy: true,
102+
Cypress: true,
103+
},
104+
}

cli.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
11
#!/usr/bin/env node
2-
if (process.env.ADMIN_BRO_DEV_ENV) {
3-
require('@babel/polyfill')
4-
require('@babel/register')({
5-
presets: [
6-
require.resolve('@babel/preset-react'),
7-
require.resolve('@babel/preset-env'),
8-
require.resolve('@babel/preset-typescript'),
9-
],
10-
plugins: [require.resolve('babel-plugin-styled-components')],
11-
extensions: ['.jsx', '.js', '.ts', '.tsx'],
12-
})
13-
require('./src/cli').default
14-
} else {
15-
require('./lib/cli').default
16-
}
2+
// eslint-disable-next-line
3+
require('./lib/cli').default

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"types": "tsc",
1010
"clean": "rm -rf lib && mkdir lib && rm -fr types && mkdir types",
1111
"build": "babel src --out-dir lib --copy-files --extensions '.ts,.js,.jsx,.tsx'",
12-
"lint": "eslint './spec/**/*.js' './spec/**/*.ts' './src/**/*.js' './src/**/*.jsx' './src/**/*.ts' './src/**/*.tsx' --ignore-pattern='*bundle.*.js' --ignore-pattern='*.d.ts'",
12+
"lint": "eslint './spec/**/*' './src/**/*' './*'",
1313
"cover": "NODE_ENV=test nyc --reporter=lcov --reporter=text-lcov npm test",
1414
"codecov": "NODE_ENV=test nyc --reporter=text-lcov npm test | codecov --pipe",
1515
"bundle": "node bin/watch-dev.js",
@@ -137,12 +137,12 @@
137137
"concurrently": "^5.1.0",
138138
"core-js": "2.5.7",
139139
"cspell": "^4.0.44",
140-
"eslint": "^5.10.0",
140+
"eslint": "^7.12.1",
141141
"eslint-config-airbnb": "^17.1.0",
142-
"eslint-plugin-import": "^2.14.0",
143-
"eslint-plugin-jsx-a11y": "^6.2.1",
142+
"eslint-plugin-import": "^2.22.1",
143+
"eslint-plugin-jsx-a11y": "^6.4.1",
144144
"eslint-plugin-mocha": "^6.2.2",
145-
"eslint-plugin-react": "^7.12.4",
145+
"eslint-plugin-react": "^7.21.2",
146146
"factory-girl": "^5.0.4",
147147
"husky": "^4.2.5",
148148
"istanbul": "^0.4.5",

0 commit comments

Comments
 (0)