@voiceflow/eslint-config 7.1.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +33 -75
- package/src/base.js +13 -0
- package/src/index.js +5 -0
- package/src/presets/airbnb.js +10 -0
- package/src/presets/common.js +105 -0
- package/src/presets/import.js +50 -0
- package/src/presets/typescript.js +59 -0
- package/.eslintrc.js +0 -6
- package/.lintstagedrc.js +0 -4
- package/README.md +0 -6
- package/commitlint.config.js +0 -3
- package/config/base.js +0 -73
- package/config/import.js +0 -27
- package/config/prettier.js +0 -4
- package/config/react.js +0 -41
- package/cypress.js +0 -10
- package/frontend.js +0 -17
- package/index.js +0 -3
- package/jest.js +0 -7
- package/mocha.js +0 -16
- package/overrides/monorepo.js +0 -19
- package/typescript.js +0 -47
- package/utility.js +0 -13
package/package.json
CHANGED
|
@@ -1,86 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voiceflow/eslint-config",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
"version": "7.2.0",
|
|
4
|
+
"main": "src/index.js",
|
|
5
|
+
"files": [
|
|
6
|
+
"src/*"
|
|
7
|
+
],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"lint": "yarn g:run-p -c lint:eslint lint:prettier",
|
|
10
|
+
"lint:eslint": "yarn g:eslint",
|
|
11
|
+
"lint:fix": "yarn g:run-p -c \"lint:eslint --fix\" \"lint:prettier --write\"",
|
|
12
|
+
"lint:prettier": "yarn g:prettier --check",
|
|
13
|
+
"test:dependencies": "yarn g:depcruise ."
|
|
8
14
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
15
|
+
"prettier": "../prettier-config/src",
|
|
16
|
+
"eslintConfig": {
|
|
17
|
+
"extends": "./src"
|
|
13
18
|
},
|
|
14
19
|
"dependencies": {
|
|
15
|
-
"@typescript-eslint/eslint-plugin": "
|
|
16
|
-
"@typescript-eslint/parser": "
|
|
20
|
+
"@typescript-eslint/eslint-plugin": "7.6.0",
|
|
21
|
+
"@typescript-eslint/parser": "7.6.0",
|
|
17
22
|
"eslint-config-airbnb-base": "15.0.0",
|
|
18
|
-
"eslint-config-prettier": "
|
|
19
|
-
"eslint-import-resolver-typescript": "3.
|
|
20
|
-
"eslint-plugin-
|
|
21
|
-
"eslint-plugin-
|
|
22
|
-
"eslint-plugin-
|
|
23
|
-
"eslint-plugin-
|
|
24
|
-
"eslint-plugin-
|
|
25
|
-
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
26
|
-
"eslint-plugin-lodash": "7.4.0",
|
|
27
|
-
"eslint-plugin-mocha": "10.1.0",
|
|
28
|
-
"eslint-plugin-no-secrets": "^0.8.9",
|
|
29
|
-
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
30
|
-
"eslint-plugin-prettier": "4.2.1",
|
|
23
|
+
"eslint-config-prettier": "9.1.0",
|
|
24
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
25
|
+
"eslint-plugin-eslint-comments": "3.2.0",
|
|
26
|
+
"eslint-plugin-import": "2.29.1",
|
|
27
|
+
"eslint-plugin-no-secrets": "0.8.9",
|
|
28
|
+
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
29
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
31
30
|
"eslint-plugin-promise": "6.1.1",
|
|
32
|
-
"eslint-plugin-
|
|
33
|
-
"eslint-plugin-
|
|
34
|
-
"eslint-plugin-
|
|
35
|
-
"eslint-plugin-
|
|
36
|
-
"
|
|
37
|
-
"eslint-plugin-xss": "0.1.12",
|
|
38
|
-
"eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@voiceflow/commitlint-config": "2.1.0",
|
|
42
|
-
"@voiceflow/git-branch-check": "1.4.0",
|
|
43
|
-
"@voiceflow/prettier-config": "1.3.0",
|
|
44
|
-
"commitizen": "4.3.0",
|
|
45
|
-
"commitlint": "17.6.1",
|
|
46
|
-
"cz-conventional-changelog": "^3.3.0",
|
|
47
|
-
"eslint": "8.39.0",
|
|
48
|
-
"fixpack": "^4.0.0",
|
|
49
|
-
"husky": "8.0.3",
|
|
50
|
-
"lint-staged": "13.1.2",
|
|
51
|
-
"prettier": "2.8.8"
|
|
31
|
+
"eslint-plugin-simple-import-sort": "12.0.0",
|
|
32
|
+
"eslint-plugin-sonarjs": "0.25.1",
|
|
33
|
+
"eslint-plugin-unicorn": "52.0.0",
|
|
34
|
+
"eslint-plugin-you-dont-need-lodash-underscore": "6.14.0",
|
|
35
|
+
"globals": "15.0.0"
|
|
52
36
|
},
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"config/*.js",
|
|
56
|
-
"overrides/*.js",
|
|
57
|
-
"!scratch.*"
|
|
58
|
-
],
|
|
59
|
-
"homepage": "https://github.com/voiceflow/eslint-config#readme",
|
|
60
|
-
"keywords": [
|
|
61
|
-
"config",
|
|
62
|
-
"eslint",
|
|
63
|
-
"lint"
|
|
64
|
-
],
|
|
65
|
-
"license": "MIT",
|
|
66
|
-
"main": "index.js",
|
|
67
|
-
"peerDependencies": {
|
|
68
|
-
"@voiceflow/prettier-config": "^1.0.2",
|
|
69
|
-
"eslint": "^8.0.0"
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": "20"
|
|
70
39
|
},
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
"type": "git",
|
|
74
|
-
"url": "git+https://github.com/voiceflow/eslint-config.git"
|
|
40
|
+
"volta": {
|
|
41
|
+
"extends": "../../package.json"
|
|
75
42
|
},
|
|
76
|
-
"
|
|
77
|
-
"commit": "git-cz",
|
|
78
|
-
"lint": "eslint \"./**/*.{js,ts}\"",
|
|
79
|
-
"lint:fix": "yarn lint --fix",
|
|
80
|
-
"lint:quiet": "yarn lint --quiet",
|
|
81
|
-
"lint:report": "yarn lint --format json -o sonar/report.json",
|
|
82
|
-
"prepare": "husky install",
|
|
83
|
-
"test": "yarn test:run",
|
|
84
|
-
"test:run": "echo \"Error: no test specified\" && exit 1"
|
|
85
|
-
}
|
|
43
|
+
"gitHead": "ca46718f7b4bbac9c11e5bc57047eb6181156e47"
|
|
86
44
|
}
|
package/src/base.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const airbnb = require('./presets/airbnb');
|
|
2
|
+
const common = require('./presets/common');
|
|
3
|
+
const import_ = require('./presets/import');
|
|
4
|
+
|
|
5
|
+
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
6
|
+
module.exports = [
|
|
7
|
+
{
|
|
8
|
+
ignores: ['**/build/**', '**/node_modules/**', '**/sonar/**', '**/.yarn/**'],
|
|
9
|
+
},
|
|
10
|
+
...airbnb,
|
|
11
|
+
...common,
|
|
12
|
+
...import_,
|
|
13
|
+
];
|
package/src/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const airbnbBestPractices = require('eslint-config-airbnb-base/rules/best-practices');
|
|
2
|
+
const airbnbErrors = require('eslint-config-airbnb-base/rules/errors');
|
|
3
|
+
const airbnbStyle = require('eslint-config-airbnb-base/rules/style');
|
|
4
|
+
const airbnbVariables = require('eslint-config-airbnb-base/rules/variables');
|
|
5
|
+
const airbnbStrict = require('eslint-config-airbnb-base/rules/strict');
|
|
6
|
+
const { env: _nodeEnv, ...airbnbNode } = require('eslint-config-airbnb-base/rules/node');
|
|
7
|
+
const { env: _es6Env, parserOptions: _es6Parser, ...airbnbES6 } = require('eslint-config-airbnb-base/rules/es6');
|
|
8
|
+
|
|
9
|
+
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
10
|
+
module.exports = [airbnbBestPractices, airbnbErrors, airbnbNode, airbnbStyle, airbnbVariables, airbnbES6, airbnbStrict];
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
const sonarjs = require('eslint-plugin-sonarjs');
|
|
2
|
+
const promise = require('eslint-plugin-promise');
|
|
3
|
+
const preferArrow = require('eslint-plugin-prefer-arrow');
|
|
4
|
+
const noSecrets = require('eslint-plugin-no-secrets');
|
|
5
|
+
const comments = require('eslint-plugin-eslint-comments');
|
|
6
|
+
const youDontNeed = require('eslint-plugin-you-dont-need-lodash-underscore');
|
|
7
|
+
const unicorn = require('eslint-plugin-unicorn');
|
|
8
|
+
const prettier = require('eslint-plugin-prettier/recommended');
|
|
9
|
+
|
|
10
|
+
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
11
|
+
module.exports = [
|
|
12
|
+
{
|
|
13
|
+
plugins: {
|
|
14
|
+
sonarjs,
|
|
15
|
+
promise,
|
|
16
|
+
unicorn,
|
|
17
|
+
'eslint-comments': comments,
|
|
18
|
+
'you-dont-need-lodash-underscore': youDontNeed,
|
|
19
|
+
'prefer-arrow': preferArrow,
|
|
20
|
+
'no-secrets': noSecrets,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{ ...sonarjs.configs.recommended, plugins: {} },
|
|
24
|
+
{ ...promise.configs.recommended, plugins: {} },
|
|
25
|
+
{ ...comments.configs.recommended, plugins: {} },
|
|
26
|
+
{ ...youDontNeed.configs.compatible, plugins: {} },
|
|
27
|
+
prettier,
|
|
28
|
+
{
|
|
29
|
+
linterOptions: {
|
|
30
|
+
reportUnusedDisableDirectives: 'error',
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
languageOptions: {
|
|
34
|
+
parserOptions: {
|
|
35
|
+
ecmaVersion: 2021,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
rules: {
|
|
40
|
+
// error
|
|
41
|
+
'arrow-parens': ['error', 'always'],
|
|
42
|
+
'callback-return': 'error',
|
|
43
|
+
'capitalized-comments': 'error',
|
|
44
|
+
'handle-callback-err': 'error',
|
|
45
|
+
'max-depth': ['error', 3],
|
|
46
|
+
'max-len': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
code: 150,
|
|
50
|
+
ignoreUrls: true,
|
|
51
|
+
ignoreStrings: true,
|
|
52
|
+
ignoreTemplateLiterals: true,
|
|
53
|
+
ignoreRegExpLiterals: true,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
'max-nested-callbacks': ['error', 5],
|
|
57
|
+
'max-params': ['error', 5],
|
|
58
|
+
'no-console': 'error',
|
|
59
|
+
'no-process-exit': 'error',
|
|
60
|
+
'no-useless-call': 'error',
|
|
61
|
+
'quote-props': ['error', 'as-needed'],
|
|
62
|
+
'prefer-arrow-callback': 'error',
|
|
63
|
+
'lines-between-class-members': 'error',
|
|
64
|
+
|
|
65
|
+
'prefer-arrow/prefer-arrow-functions': [
|
|
66
|
+
'error',
|
|
67
|
+
{
|
|
68
|
+
disallowPrototype: false,
|
|
69
|
+
singleReturnOnly: true,
|
|
70
|
+
classPropertiesAllowed: false,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
|
|
74
|
+
'eslint-comments/no-unused-disable': 'error',
|
|
75
|
+
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
|
|
76
|
+
|
|
77
|
+
'no-secrets/no-secrets': 'error',
|
|
78
|
+
|
|
79
|
+
'unicorn/better-regex': 'error',
|
|
80
|
+
'unicorn/prefer-set-has': 'error',
|
|
81
|
+
|
|
82
|
+
// warn
|
|
83
|
+
'sonarjs/no-duplicate-string': 'warn',
|
|
84
|
+
|
|
85
|
+
// off
|
|
86
|
+
'no-plusplus': 'off',
|
|
87
|
+
'no-continue': 'off',
|
|
88
|
+
'require-jsdoc': 'off', // not sure we want this
|
|
89
|
+
quotes: ['error', 'single', 'avoid-escape'],
|
|
90
|
+
'valid-jsdoc': 'off',
|
|
91
|
+
'func-names': 'off',
|
|
92
|
+
'class-methods-use-this': 'off',
|
|
93
|
+
camelcase: 'off',
|
|
94
|
+
'no-underscore-dangle': 'off',
|
|
95
|
+
'no-restricted-syntax': 'off',
|
|
96
|
+
|
|
97
|
+
// disabled until eslint 9 is supported
|
|
98
|
+
'sonarjs/no-gratuitous-expressions': 'off',
|
|
99
|
+
'sonarjs/no-extra-arguments': 'off',
|
|
100
|
+
'sonarjs/no-use-of-empty-return-value': 'off',
|
|
101
|
+
'sonarjs/no-empty-collection': 'off',
|
|
102
|
+
'sonarjs/no-unused-collection': 'off',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const globals = require('globals');
|
|
2
|
+
const import_ = require('eslint-plugin-import');
|
|
3
|
+
const simpleImportSort = require('eslint-plugin-simple-import-sort');
|
|
4
|
+
const {
|
|
5
|
+
env: _importsEnv,
|
|
6
|
+
parserOptions: _importsParser,
|
|
7
|
+
...airbnbImports
|
|
8
|
+
} = require('eslint-config-airbnb-base/rules/imports');
|
|
9
|
+
|
|
10
|
+
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
11
|
+
module.exports = [
|
|
12
|
+
{
|
|
13
|
+
plugins: {
|
|
14
|
+
import: import_,
|
|
15
|
+
'simple-import-sort': simpleImportSort,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{ ...airbnbImports, plugins: {} },
|
|
19
|
+
{
|
|
20
|
+
languageOptions: {
|
|
21
|
+
parserOptions: {
|
|
22
|
+
sourceType: 'module',
|
|
23
|
+
},
|
|
24
|
+
globals: {
|
|
25
|
+
...globals.es2021,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
rules: {
|
|
30
|
+
// error
|
|
31
|
+
'simple-import-sort/imports': 'error',
|
|
32
|
+
'simple-import-sort/exports': 'error',
|
|
33
|
+
'import/first': 'error',
|
|
34
|
+
'import/no-duplicates': 'error',
|
|
35
|
+
|
|
36
|
+
// off
|
|
37
|
+
'sort-imports': 'off',
|
|
38
|
+
'import/order': 'off',
|
|
39
|
+
'import/no-amd': 'off',
|
|
40
|
+
'import/no-named-as-default': 'off',
|
|
41
|
+
'import/newline-after-import': 'off',
|
|
42
|
+
'import/extensions': 'off',
|
|
43
|
+
'import/no-extraneous-dependencies': 'off',
|
|
44
|
+
'import/prefer-default-export': 'off',
|
|
45
|
+
'import/no-unresolved': 'off',
|
|
46
|
+
'import/no-self-import': 'off',
|
|
47
|
+
'import/no-mutable-exports': 'off',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const typescript = require('@typescript-eslint/eslint-plugin');
|
|
2
|
+
const typescriptParser = require('@typescript-eslint/parser');
|
|
3
|
+
|
|
4
|
+
/** @type {import('eslint').Linter.FlatConfig} */
|
|
5
|
+
module.exports = {
|
|
6
|
+
files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
|
|
7
|
+
|
|
8
|
+
plugins: {
|
|
9
|
+
'@typescript-eslint': typescript,
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parser: typescriptParser,
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
rules: {
|
|
17
|
+
...typescript.configs.recommended.rules,
|
|
18
|
+
|
|
19
|
+
// error
|
|
20
|
+
'@typescript-eslint/no-empty-interface': [
|
|
21
|
+
'error',
|
|
22
|
+
{
|
|
23
|
+
// Allow `interface T extends U {}`
|
|
24
|
+
allowSingleExtends: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
28
|
+
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }],
|
|
29
|
+
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
|
|
30
|
+
|
|
31
|
+
// off
|
|
32
|
+
'no-shadow': 'off',
|
|
33
|
+
'no-unused-vars': 'off',
|
|
34
|
+
'no-use-before-define': 'off',
|
|
35
|
+
'no-useless-constructor': 'off',
|
|
36
|
+
|
|
37
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
38
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
39
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
40
|
+
|
|
41
|
+
'import/no-unresolved': 'off',
|
|
42
|
+
'import/export': 'off',
|
|
43
|
+
'import/named': 'off',
|
|
44
|
+
'import/no-named-as-default-member': 'off',
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
settings: {
|
|
48
|
+
'import/parsers': {
|
|
49
|
+
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
50
|
+
},
|
|
51
|
+
'import/resolver': {
|
|
52
|
+
typescript: {
|
|
53
|
+
alwaysTryTypes: true,
|
|
54
|
+
|
|
55
|
+
project: 'tsconfig.json',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
package/.eslintrc.js
DELETED
package/.lintstagedrc.js
DELETED
package/README.md
DELETED
package/commitlint.config.js
DELETED
package/config/base.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
'airbnb-base', // include import rules
|
|
4
|
-
'plugin:sonarjs/recommended',
|
|
5
|
-
'plugin:promise/recommended',
|
|
6
|
-
'plugin:eslint-comments/recommended',
|
|
7
|
-
'plugin:you-dont-need-lodash-underscore/compatible',
|
|
8
|
-
],
|
|
9
|
-
plugins: ['sonarjs', 'promise', 'prefer-arrow', 'no-secrets', 'you-dont-need-lodash-underscore', 'unicorn'],
|
|
10
|
-
parserOptions: {
|
|
11
|
-
ecmaVersion: 9,
|
|
12
|
-
},
|
|
13
|
-
// https://eslint.org/docs/user-guide/configuring/rules#report-unused-eslint-disable-comments
|
|
14
|
-
reportUnusedDisableDirectives: true,
|
|
15
|
-
rules: {
|
|
16
|
-
// error
|
|
17
|
-
'arrow-parens': ['error', 'always'],
|
|
18
|
-
'callback-return': 'error',
|
|
19
|
-
'capitalized-comments': 'error',
|
|
20
|
-
'handle-callback-err': 'error',
|
|
21
|
-
'max-depth': ['error', 3],
|
|
22
|
-
'max-len': [
|
|
23
|
-
'error',
|
|
24
|
-
{
|
|
25
|
-
code: 150,
|
|
26
|
-
ignoreUrls: true,
|
|
27
|
-
ignoreStrings: true,
|
|
28
|
-
ignoreTemplateLiterals: true,
|
|
29
|
-
ignoreRegExpLiterals: true,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
'max-nested-callbacks': ['error', 5],
|
|
33
|
-
'max-params': ['error', 5],
|
|
34
|
-
'no-console': 'error',
|
|
35
|
-
'no-process-exit': 'error',
|
|
36
|
-
'no-useless-call': 'error',
|
|
37
|
-
'quote-props': ['error', 'as-needed'],
|
|
38
|
-
'prefer-arrow-callback': 'error',
|
|
39
|
-
'lines-between-class-members': 'error',
|
|
40
|
-
|
|
41
|
-
'prefer-arrow/prefer-arrow-functions': [
|
|
42
|
-
'error',
|
|
43
|
-
{
|
|
44
|
-
disallowPrototype: false,
|
|
45
|
-
singleReturnOnly: true,
|
|
46
|
-
classPropertiesAllowed: false,
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
|
|
50
|
-
'eslint-comments/no-unused-disable': 'error',
|
|
51
|
-
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
|
|
52
|
-
|
|
53
|
-
'no-secrets/no-secrets': 'error',
|
|
54
|
-
|
|
55
|
-
'unicorn/better-regex': 'error',
|
|
56
|
-
'unicorn/prefer-set-has': 'error',
|
|
57
|
-
|
|
58
|
-
// warn
|
|
59
|
-
'sonarjs/no-duplicate-string': 'warn',
|
|
60
|
-
|
|
61
|
-
// off
|
|
62
|
-
'no-plusplus': 'off',
|
|
63
|
-
'no-continue': 'off',
|
|
64
|
-
'require-jsdoc': 'off', // not sure we want this
|
|
65
|
-
quotes: ['error', 'single', 'avoid-escape'],
|
|
66
|
-
'valid-jsdoc': 'off',
|
|
67
|
-
'func-names': 'off',
|
|
68
|
-
'class-methods-use-this': 'off',
|
|
69
|
-
'import/prefer-default-export': 'off',
|
|
70
|
-
camelcase: 'off',
|
|
71
|
-
'no-underscore-dangle': 'off',
|
|
72
|
-
},
|
|
73
|
-
};
|
package/config/import.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: ['simple-import-sort', 'import'],
|
|
3
|
-
parserOptions: {
|
|
4
|
-
sourceType: 'module',
|
|
5
|
-
},
|
|
6
|
-
env: {
|
|
7
|
-
es6: true,
|
|
8
|
-
},
|
|
9
|
-
rules: {
|
|
10
|
-
// error
|
|
11
|
-
'simple-import-sort/imports': 'error',
|
|
12
|
-
'simple-import-sort/exports': 'error',
|
|
13
|
-
|
|
14
|
-
'import/extensions': ['error', 'ignorePackages', { js: 'never', ts: 'never', jsx: 'never', tsx: 'never' }],
|
|
15
|
-
'import/first': 'error',
|
|
16
|
-
'import/newline-after-import': 'error',
|
|
17
|
-
'import/no-duplicates': 'error',
|
|
18
|
-
|
|
19
|
-
// off
|
|
20
|
-
'sort-imports': 'off',
|
|
21
|
-
'import/order': 'off',
|
|
22
|
-
'import/no-named-as-default': 'off',
|
|
23
|
-
},
|
|
24
|
-
settings: {
|
|
25
|
-
'import/extensions': ['.js', '.ts', '.jsx', '.tsx'],
|
|
26
|
-
},
|
|
27
|
-
};
|
package/config/prettier.js
DELETED
package/config/react.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['plugin:react/recommended', 'plugin:jsx-a11y/recommended'],
|
|
3
|
-
plugins: ['react', 'react-hooks', 'jsx-a11y'],
|
|
4
|
-
parserOptions: {
|
|
5
|
-
ecmaFeatures: {
|
|
6
|
-
jsx: true,
|
|
7
|
-
},
|
|
8
|
-
},
|
|
9
|
-
rules: {
|
|
10
|
-
// error
|
|
11
|
-
'react/jsx-fragments': 'error',
|
|
12
|
-
|
|
13
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
14
|
-
|
|
15
|
-
// warn
|
|
16
|
-
'react/jsx-curly-brace-presence': 'warn',
|
|
17
|
-
'react/jsx-filename-extension': ['warn', { extensions: ['.jsx', '.tsx'] }],
|
|
18
|
-
|
|
19
|
-
'jsx-a11y/click-events-have-key-events': 'warn',
|
|
20
|
-
'jsx-a11y/label-has-for': 'warn',
|
|
21
|
-
'jsx-a11y/label-has-associated-control': 'warn',
|
|
22
|
-
'jsx-a11y/no-static-element-interactions': 'warn',
|
|
23
|
-
|
|
24
|
-
// off
|
|
25
|
-
'react/destructuring-assignment': 'off',
|
|
26
|
-
'react/no-unescaped-entities': 'off',
|
|
27
|
-
'react/prop-types': 'off',
|
|
28
|
-
|
|
29
|
-
// high performance overhead & low value
|
|
30
|
-
'react/display-name': 'off',
|
|
31
|
-
'react/no-string-refs': 'off',
|
|
32
|
-
'react/require-render-return': 'off',
|
|
33
|
-
'react/no-direct-mutation-state': 'off',
|
|
34
|
-
'react/no-deprecated': 'off',
|
|
35
|
-
},
|
|
36
|
-
settings: {
|
|
37
|
-
react: {
|
|
38
|
-
version: 'detect',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
};
|
package/cypress.js
DELETED
package/frontend.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['./config/react.js'],
|
|
3
|
-
plugins: ['xss', 'lodash'],
|
|
4
|
-
env: {
|
|
5
|
-
browser: true,
|
|
6
|
-
},
|
|
7
|
-
rules: {
|
|
8
|
-
// error
|
|
9
|
-
'xss/no-mixed-html': 'error',
|
|
10
|
-
'xss/no-location-href-assign': 'error',
|
|
11
|
-
|
|
12
|
-
'lodash/import-scope': 'error',
|
|
13
|
-
},
|
|
14
|
-
settings: {
|
|
15
|
-
polyfills: ['Number.isNaN', 'Promise', 'Array.from', 'Object.assign', 'Object.values', 'Set'],
|
|
16
|
-
},
|
|
17
|
-
};
|
package/index.js
DELETED
package/jest.js
DELETED
package/mocha.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: ['mocha'],
|
|
3
|
-
env: {
|
|
4
|
-
mocha: true,
|
|
5
|
-
},
|
|
6
|
-
rules: {
|
|
7
|
-
'mocha/handle-done-callback': 'error',
|
|
8
|
-
'mocha/no-exclusive-tests': 'error',
|
|
9
|
-
'mocha/no-global-tests': 'error',
|
|
10
|
-
'mocha/no-identical-title': 'error',
|
|
11
|
-
'mocha/no-nested-tests': 'error',
|
|
12
|
-
'mocha/no-pending-tests': 'error',
|
|
13
|
-
'mocha/no-return-and-callback': 'error',
|
|
14
|
-
'mocha/no-sibling-hooks': 'error',
|
|
15
|
-
},
|
|
16
|
-
};
|
package/overrides/monorepo.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
module.exports = (rootDir = process.cwd(), workspace = 'packages') => {
|
|
5
|
-
const packagesDir = path.join(rootDir, workspace);
|
|
6
|
-
const packages = fs.readdirSync(packagesDir);
|
|
7
|
-
|
|
8
|
-
return packages.map((pkg) => ({
|
|
9
|
-
files: [`${workspace}/${pkg}/**/*`],
|
|
10
|
-
extends: ['@voiceflow/eslint-config/typescript'],
|
|
11
|
-
settings: {
|
|
12
|
-
'import/resolver': {
|
|
13
|
-
typescript: {
|
|
14
|
-
project: path.join(packagesDir, pkg, 'tsconfig.json'),
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
}));
|
|
19
|
-
};
|
package/typescript.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
plugins: ['@typescript-eslint'],
|
|
4
|
-
overrides: [
|
|
5
|
-
{
|
|
6
|
-
files: ['*.ts', '*.tsx'],
|
|
7
|
-
extends: ['plugin:@typescript-eslint/recommended'],
|
|
8
|
-
rules: {
|
|
9
|
-
// error
|
|
10
|
-
'@typescript-eslint/no-empty-interface': [
|
|
11
|
-
'error',
|
|
12
|
-
{
|
|
13
|
-
// Allow `interface T extends U {}`
|
|
14
|
-
allowSingleExtends: true,
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
18
|
-
|
|
19
|
-
// off
|
|
20
|
-
'no-shadow': 'off',
|
|
21
|
-
'no-unused-vars': 'off',
|
|
22
|
-
'no-use-before-define': 'off',
|
|
23
|
-
'no-useless-constructor': 'off',
|
|
24
|
-
|
|
25
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
26
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
27
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
28
|
-
|
|
29
|
-
'import/no-unresolved': 'off',
|
|
30
|
-
'import/export': 'off',
|
|
31
|
-
'import/named': 'off',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
settings: {
|
|
36
|
-
'import/parsers': {
|
|
37
|
-
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
38
|
-
},
|
|
39
|
-
'import/resolver': {
|
|
40
|
-
typescript: {
|
|
41
|
-
alwaysTryTypes: true,
|
|
42
|
-
|
|
43
|
-
project: 'tsconfig.json',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
};
|