@fullstacksjs/eslint-config 11.1.17 → 11.1.19
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/README.md +17 -1
- package/cjs/index.js +114 -0
- package/cjs/modules/base.js +213 -0
- package/cjs/modules/cypress.js +30 -0
- package/cjs/modules/functional.js +27 -0
- package/cjs/modules/ignore.js +17 -0
- package/cjs/modules/imports.js +112 -0
- package/cjs/modules/jest.js +82 -0
- package/cjs/modules/next.js +40 -0
- package/cjs/modules/node.js +68 -0
- package/cjs/modules/perfectionist.js +41 -0
- package/cjs/modules/playwright.js +26 -0
- package/cjs/modules/prettier.js +96 -0
- package/cjs/modules/promise.js +34 -0
- package/cjs/modules/react.js +123 -0
- package/cjs/modules/storybook.js +39 -0
- package/cjs/modules/tailwind.js +26 -0
- package/cjs/modules/tests.js +54 -0
- package/cjs/modules/typescript.js +276 -0
- package/cjs/modules/vitest.js +91 -0
- package/cjs/option.d.ts +25 -0
- package/cjs/utils/conditions.js +25 -0
- package/cjs/utils/globs.js +37 -0
- package/cjs/utils/naming-convention.js +63 -0
- package/package.json +13 -4
- package/src/index.js +53 -25
- package/src/modules/ignore.js +12 -0
- package/src/option.d.ts +3 -1
- package/src/utils/compose.js +0 -12
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _eslintPluginN = _interopRequireDefault(require("eslint-plugin-n"));
|
|
8
|
+
var _conditions = require("../utils/conditions.js");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
/**
|
|
11
|
+
* @param { import('../option.d.ts').Options } options
|
|
12
|
+
* @return { import('eslint').Linter.Config }
|
|
13
|
+
*/
|
|
14
|
+
function node(options = {}) {
|
|
15
|
+
return {
|
|
16
|
+
plugins: {
|
|
17
|
+
n: _eslintPluginN.default
|
|
18
|
+
},
|
|
19
|
+
rules: {
|
|
20
|
+
'n/callback-return': 'off',
|
|
21
|
+
'n/exports-style': ['error', 'module.exports', {
|
|
22
|
+
allowBatchAssign: false
|
|
23
|
+
}],
|
|
24
|
+
'n/global-require': 'warn',
|
|
25
|
+
'n/handle-callback-err': 'warn',
|
|
26
|
+
'n/hashbang': 'off',
|
|
27
|
+
// Cannot ignore other files
|
|
28
|
+
'n/no-callback-literal': 'off',
|
|
29
|
+
'n/no-deprecated-api': 'error',
|
|
30
|
+
'n/no-exports-assign': 'error',
|
|
31
|
+
'n/no-mixed-requires': 'warn',
|
|
32
|
+
'n/no-new-require': 'error',
|
|
33
|
+
'n/no-path-concat': 'error',
|
|
34
|
+
'n/no-process-env': 'error',
|
|
35
|
+
'n/no-process-exit': 'off',
|
|
36
|
+
'n/no-restricted-import': 'off',
|
|
37
|
+
'n/no-restricted-require': 'off',
|
|
38
|
+
'n/no-sync': (0, _conditions.strict)(options, 'warn'),
|
|
39
|
+
'n/no-unpublished-bin': 'warn',
|
|
40
|
+
'n/no-unpublished-import': 'warn',
|
|
41
|
+
'n/no-unpublished-require': 'warn',
|
|
42
|
+
'n/no-unsupported-features/es-builtins': 'off',
|
|
43
|
+
// Nice but not a general rule
|
|
44
|
+
'n/no-unsupported-features/es-syntax': 'off',
|
|
45
|
+
// Nice but not a general rule
|
|
46
|
+
'n/no-unsupported-features/node-builtins': 'off',
|
|
47
|
+
// Nice but not a general rule
|
|
48
|
+
'n/prefer-global/buffer': 'warn',
|
|
49
|
+
'n/prefer-global/console': 'warn',
|
|
50
|
+
'n/prefer-global/process': 'warn',
|
|
51
|
+
'n/prefer-global/text-decoder': 'warn',
|
|
52
|
+
'n/prefer-global/text-encoder': 'warn',
|
|
53
|
+
'n/prefer-global/url-search-params': 'warn',
|
|
54
|
+
'n/prefer-global/url': 'warn',
|
|
55
|
+
'n/prefer-node-protocol': 'warn',
|
|
56
|
+
'n/prefer-promises/dns': 'warn',
|
|
57
|
+
'n/prefer-promises/fs': 'warn',
|
|
58
|
+
'n/process-exit-as-throw': 'error',
|
|
59
|
+
// Disabled
|
|
60
|
+
'n/file-extension-in-import': 'off',
|
|
61
|
+
'n/no-extraneous-import': 'off',
|
|
62
|
+
'n/no-extraneous-require': 'off',
|
|
63
|
+
'n/no-missing-import': 'off',
|
|
64
|
+
'n/no-missing-require': 'off'
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
module.exports = node;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _eslintPluginPerfectionist = _interopRequireDefault(require("eslint-plugin-perfectionist"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/**
|
|
10
|
+
* @return { import('eslint').Linter.Config }
|
|
11
|
+
*/
|
|
12
|
+
function perfectionist() {
|
|
13
|
+
return {
|
|
14
|
+
plugins: {
|
|
15
|
+
perfectionist: _eslintPluginPerfectionist.default
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
'perfectionist/sort-array-includes': 'warn',
|
|
19
|
+
'perfectionist/sort-astro-attributes': 'warn',
|
|
20
|
+
'perfectionist/sort-classes': 'warn',
|
|
21
|
+
'perfectionist/sort-enums': 'warn',
|
|
22
|
+
'perfectionist/sort-exports': 'warn',
|
|
23
|
+
'perfectionist/sort-imports': ['warn', {}],
|
|
24
|
+
'perfectionist/sort-interfaces': 'off',
|
|
25
|
+
'perfectionist/sort-intersection-types': 'warn',
|
|
26
|
+
'perfectionist/sort-jsx-props': 'warn',
|
|
27
|
+
'perfectionist/sort-maps': 'warn',
|
|
28
|
+
'perfectionist/sort-named-exports': 'warn',
|
|
29
|
+
'perfectionist/sort-named-imports': 'warn',
|
|
30
|
+
'perfectionist/sort-object-types': 'off',
|
|
31
|
+
'perfectionist/sort-objects': 'off',
|
|
32
|
+
'perfectionist/sort-sets': 'warn',
|
|
33
|
+
'perfectionist/sort-svelte-attributes': 'warn',
|
|
34
|
+
'perfectionist/sort-switch-case': 'warn',
|
|
35
|
+
'perfectionist/sort-union-types': 'warn',
|
|
36
|
+
'perfectionist/sort-variable-declarations': 'warn',
|
|
37
|
+
'perfectionist/sort-vue-attributes': 'warn'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
module.exports = perfectionist;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _eslintPluginPlaywright = _interopRequireDefault(require("eslint-plugin-playwright"));
|
|
8
|
+
var _globs = require("../utils/globs.js");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
/** @return { import('eslint').Linter.Config } */
|
|
11
|
+
function playwright() {
|
|
12
|
+
return {
|
|
13
|
+
plugins: {
|
|
14
|
+
playwright: _eslintPluginPlaywright.default
|
|
15
|
+
},
|
|
16
|
+
files: _globs.globs.e2e,
|
|
17
|
+
rules: {
|
|
18
|
+
'jest/no-standalone-expect': ['error', {
|
|
19
|
+
additionalTestBlockFunctions: ['test.jestPlaywrightDebug', 'it.jestPlaywrightDebug', 'test.jestPlaywrightSkip', 'it.jestPlaywrightSkip', 'test.jestPlaywrightConfig', 'it.jestPlaywrightConfig']
|
|
20
|
+
}],
|
|
21
|
+
'playwright/missing-playwright-await': 'error',
|
|
22
|
+
'playwright/no-page-pause': 'warn'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
module.exports = playwright;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _eslintPluginPrettier = _interopRequireDefault(require("eslint-plugin-prettier"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/** @return { import('eslint').Linter.Config } */
|
|
10
|
+
function prettier() {
|
|
11
|
+
return {
|
|
12
|
+
plugins: {
|
|
13
|
+
prettier: _eslintPluginPrettier.default
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
'prettier/prettier': 'error',
|
|
17
|
+
'curly': 'off',
|
|
18
|
+
'brace-style': 'off',
|
|
19
|
+
'no-unexpected-multiline': 'off',
|
|
20
|
+
'@typescript-eslint/lines-around-comment': 'off',
|
|
21
|
+
'@typescript-eslint/quotes': 'off',
|
|
22
|
+
'@typescript-eslint/block-spacing': 'off',
|
|
23
|
+
'@typescript-eslint/brace-style': 'off',
|
|
24
|
+
'@typescript-eslint/comma-dangle': 'off',
|
|
25
|
+
'@typescript-eslint/comma-spacing': 'off',
|
|
26
|
+
'@typescript-eslint/func-call-spacing': 'off',
|
|
27
|
+
'@typescript-eslint/indent': 'off',
|
|
28
|
+
'@typescript-eslint/key-spacing': 'off',
|
|
29
|
+
'@typescript-eslint/keyword-spacing': 'off',
|
|
30
|
+
'@typescript-eslint/member-delimiter-style': 'off',
|
|
31
|
+
'@typescript-eslint/no-extra-parens': 'off',
|
|
32
|
+
'@typescript-eslint/no-extra-semi': 'off',
|
|
33
|
+
'@typescript-eslint/object-curly-spacing': 'off',
|
|
34
|
+
'@typescript-eslint/semi': 'off',
|
|
35
|
+
'@typescript-eslint/space-before-blocks': 'off',
|
|
36
|
+
'@typescript-eslint/space-before-function-paren': 'off',
|
|
37
|
+
'@typescript-eslint/space-infix-ops': 'off',
|
|
38
|
+
'@typescript-eslint/type-annotation-spacing': 'off',
|
|
39
|
+
'react/jsx-child-element-spacing': 'off',
|
|
40
|
+
'react/jsx-closing-bracket-location': 'off',
|
|
41
|
+
'react/jsx-closing-tag-location': 'off',
|
|
42
|
+
'react/jsx-curly-newline': 'off',
|
|
43
|
+
'react/jsx-curly-spacing': 'off',
|
|
44
|
+
'react/jsx-equals-spacing': 'off',
|
|
45
|
+
'react/jsx-first-prop-new-line': 'off',
|
|
46
|
+
'react/jsx-indent': 'off',
|
|
47
|
+
'react/jsx-indent-props': 'off',
|
|
48
|
+
'react/jsx-max-props-per-line': 'off',
|
|
49
|
+
'react/jsx-newline': 'off',
|
|
50
|
+
'react/jsx-one-expression-per-line': 'off',
|
|
51
|
+
'react/jsx-props-no-multi-spaces': 'off',
|
|
52
|
+
'react/jsx-tag-spacing': 'off',
|
|
53
|
+
'react/jsx-wrap-multilines': 'off',
|
|
54
|
+
'vue/html-self-closing': 'off',
|
|
55
|
+
'vue/max-len': 'off',
|
|
56
|
+
'vue/array-bracket-newline': 'off',
|
|
57
|
+
'vue/array-bracket-spacing': 'off',
|
|
58
|
+
'vue/array-element-newline': 'off',
|
|
59
|
+
'vue/arrow-spacing': 'off',
|
|
60
|
+
'vue/block-spacing': 'off',
|
|
61
|
+
'vue/block-tag-newline': 'off',
|
|
62
|
+
'vue/brace-style': 'off',
|
|
63
|
+
'vue/comma-dangle': 'off',
|
|
64
|
+
'vue/comma-spacing': 'off',
|
|
65
|
+
'vue/comma-style': 'off',
|
|
66
|
+
'vue/dot-location': 'off',
|
|
67
|
+
'vue/func-call-spacing': 'off',
|
|
68
|
+
'vue/html-closing-bracket-newline': 'off',
|
|
69
|
+
'vue/html-closing-bracket-spacing': 'off',
|
|
70
|
+
'vue/html-end-tags': 'off',
|
|
71
|
+
'vue/html-indent': 'off',
|
|
72
|
+
'vue/html-quotes': 'off',
|
|
73
|
+
'vue/key-spacing': 'off',
|
|
74
|
+
'vue/keyword-spacing': 'off',
|
|
75
|
+
'vue/max-attributes-per-line': 'off',
|
|
76
|
+
'vue/multiline-html-element-content-newline': 'off',
|
|
77
|
+
'vue/multiline-ternary': 'off',
|
|
78
|
+
'vue/mustache-interpolation-spacing': 'off',
|
|
79
|
+
'vue/no-extra-parens': 'off',
|
|
80
|
+
'vue/no-multi-spaces': 'off',
|
|
81
|
+
'vue/no-spaces-around-equal-signs-in-attribute': 'off',
|
|
82
|
+
'vue/object-curly-newline': 'off',
|
|
83
|
+
'vue/object-curly-spacing': 'off',
|
|
84
|
+
'vue/object-property-newline': 'off',
|
|
85
|
+
'vue/operator-linebreak': 'off',
|
|
86
|
+
'vue/quote-props': 'off',
|
|
87
|
+
'vue/script-indent': 'off',
|
|
88
|
+
'vue/singleline-html-element-content-newline': 'off',
|
|
89
|
+
'vue/space-in-parens': 'off',
|
|
90
|
+
'vue/space-infix-ops': 'off',
|
|
91
|
+
'vue/space-unary-ops': 'off',
|
|
92
|
+
'vue/template-curly-spacing': 'off'
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
module.exports = prettier;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _eslintPluginPromise = _interopRequireDefault(require("eslint-plugin-promise"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/** @return { import('eslint').Linter.Config } */
|
|
10
|
+
function promise() {
|
|
11
|
+
return {
|
|
12
|
+
plugins: {
|
|
13
|
+
promise: _eslintPluginPromise.default
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
'promise/always-return': 'off',
|
|
17
|
+
'promise/avoid-new': 'off',
|
|
18
|
+
'promise/catch-or-return': 'off',
|
|
19
|
+
'promise/no-callback-in-promise': 'off',
|
|
20
|
+
'promise/no-native': 'off',
|
|
21
|
+
'promise/no-nesting': 'off',
|
|
22
|
+
'promise/no-new-statics': 'error',
|
|
23
|
+
'promise/no-promise-in-callback': 'error',
|
|
24
|
+
'promise/no-return-in-finally': 'warn',
|
|
25
|
+
'promise/no-return-wrap': 'error',
|
|
26
|
+
'promise/param-names': 'warn',
|
|
27
|
+
'promise/prefer-await-to-callbacks': 'off',
|
|
28
|
+
'promise/prefer-await-to-then': 'off',
|
|
29
|
+
'promise/valid-params': 'warn',
|
|
30
|
+
'promise/no-multiple-resolved': 'warn'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
module.exports = promise;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _eslintPlugin = _interopRequireDefault(require("@eslint-react/eslint-plugin"));
|
|
8
|
+
var _eslintPluginJsxA11y = _interopRequireDefault(require("eslint-plugin-jsx-a11y"));
|
|
9
|
+
var _eslintPluginReactHooks = _interopRequireDefault(require("eslint-plugin-react-hooks"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
/** @return { import('eslint').Linter.Config } */
|
|
12
|
+
function react() {
|
|
13
|
+
return {
|
|
14
|
+
plugins: {
|
|
15
|
+
..._eslintPlugin.default.configs.all.plugins,
|
|
16
|
+
'react-hooks': _eslintPluginReactHooks.default,
|
|
17
|
+
'jsx-a11y': _eslintPluginJsxA11y.default
|
|
18
|
+
},
|
|
19
|
+
settings: {
|
|
20
|
+
react: {
|
|
21
|
+
pragma: 'React',
|
|
22
|
+
version: 'detect'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
'@eslint-react/dom/no-children-in-void-dom-elements': 'warn',
|
|
27
|
+
'@eslint-react/dom/no-dangerously-set-innerhtml': 'warn',
|
|
28
|
+
'@eslint-react/dom/no-dangerously-set-innerhtml-with-children': 'error',
|
|
29
|
+
'@eslint-react/dom/no-find-dom-node': 'error',
|
|
30
|
+
'@eslint-react/dom/no-missing-button-type': 'warn',
|
|
31
|
+
'@eslint-react/dom/no-missing-iframe-sandbox': 'warn',
|
|
32
|
+
'@eslint-react/dom/no-namespace': 'error',
|
|
33
|
+
'@eslint-react/dom/no-render-return-value': 'error',
|
|
34
|
+
'@eslint-react/dom/no-script-url': 'warn',
|
|
35
|
+
'@eslint-react/dom/no-unsafe-iframe-sandbox': 'warn',
|
|
36
|
+
'@eslint-react/dom/no-unsafe-target-blank': 'warn',
|
|
37
|
+
'@eslint-react/ensure-forward-ref-using-ref': 'warn',
|
|
38
|
+
'@eslint-react/no-access-state-in-setstate': 'error',
|
|
39
|
+
'@eslint-react/no-array-index-key': 'warn',
|
|
40
|
+
'@eslint-react/no-children-count': 'warn',
|
|
41
|
+
'@eslint-react/no-children-for-each': 'warn',
|
|
42
|
+
'@eslint-react/no-children-map': 'warn',
|
|
43
|
+
'@eslint-react/no-children-only': 'warn',
|
|
44
|
+
'@eslint-react/no-children-prop': 'warn',
|
|
45
|
+
'@eslint-react/no-children-to-array': 'warn',
|
|
46
|
+
'@eslint-react/no-clone-element': 'warn',
|
|
47
|
+
'@eslint-react/no-comment-textnodes': 'warn',
|
|
48
|
+
'@eslint-react/no-component-will-mount': 'error',
|
|
49
|
+
'@eslint-react/no-component-will-receive-props': 'error',
|
|
50
|
+
'@eslint-react/no-component-will-update': 'error',
|
|
51
|
+
'@eslint-react/no-create-ref': 'error',
|
|
52
|
+
'@eslint-react/no-direct-mutation-state': 'error',
|
|
53
|
+
'@eslint-react/no-duplicate-key': 'error',
|
|
54
|
+
'@eslint-react/no-implicit-key': 'error',
|
|
55
|
+
'@eslint-react/no-missing-key': 'error',
|
|
56
|
+
'@eslint-react/no-nested-components': 'warn',
|
|
57
|
+
'@eslint-react/no-redundant-should-component-update': 'error',
|
|
58
|
+
'@eslint-react/no-set-state-in-component-did-mount': 'warn',
|
|
59
|
+
'@eslint-react/no-set-state-in-component-did-update': 'warn',
|
|
60
|
+
'@eslint-react/no-set-state-in-component-will-update': 'warn',
|
|
61
|
+
'@eslint-react/no-string-refs': 'error',
|
|
62
|
+
'@eslint-react/no-unsafe-component-will-mount': 'warn',
|
|
63
|
+
'@eslint-react/no-unsafe-component-will-receive-props': 'warn',
|
|
64
|
+
'@eslint-react/no-unsafe-component-will-update': 'warn',
|
|
65
|
+
'@eslint-react/no-unstable-context-value': 'error',
|
|
66
|
+
'@eslint-react/no-unstable-default-props': 'error',
|
|
67
|
+
'@eslint-react/no-unused-class-component-members': 'warn',
|
|
68
|
+
'@eslint-react/no-unused-state': 'warn',
|
|
69
|
+
'@eslint-react/no-useless-fragment': 'warn',
|
|
70
|
+
'@eslint-react/prefer-destructuring-assignment': 'warn',
|
|
71
|
+
'@eslint-react/prefer-shorthand-boolean': 'warn',
|
|
72
|
+
'@eslint-react/prefer-shorthand-fragment': 'warn',
|
|
73
|
+
'@eslint-react/hooks-extra/ensure-custom-hooks-using-other-hooks': 'warn',
|
|
74
|
+
'@eslint-react/hooks-extra/ensure-use-memo-has-non-empty-deps': 'warn',
|
|
75
|
+
'@eslint-react/hooks-extra/prefer-use-state-lazy-initialization': 'warn',
|
|
76
|
+
'@eslint-react/naming-convention/component-name': 'warn',
|
|
77
|
+
'@eslint-react/naming-convention/filename': 'off',
|
|
78
|
+
'@eslint-react/naming-convention/filename-extension': ['warn', {
|
|
79
|
+
extensions: ['.jsx', '.tsx']
|
|
80
|
+
}],
|
|
81
|
+
'@eslint-react/naming-convention/use-state': 'off',
|
|
82
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
83
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
84
|
+
'jsx-a11y/alt-text': 'warn',
|
|
85
|
+
'jsx-a11y/anchor-has-content': 'error',
|
|
86
|
+
'jsx-a11y/anchor-is-valid': 'error',
|
|
87
|
+
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
|
88
|
+
'jsx-a11y/aria-props': 'error',
|
|
89
|
+
'jsx-a11y/aria-proptypes': 'error',
|
|
90
|
+
'jsx-a11y/aria-role': 'error',
|
|
91
|
+
'jsx-a11y/aria-unsupported-elements': 'error',
|
|
92
|
+
'jsx-a11y/autocomplete-valid': 'off',
|
|
93
|
+
'jsx-a11y/click-events-have-key-events': 'error',
|
|
94
|
+
'jsx-a11y/control-has-associated-label': 'off',
|
|
95
|
+
'jsx-a11y/heading-has-content': 'error',
|
|
96
|
+
'jsx-a11y/html-has-lang': 'error',
|
|
97
|
+
'jsx-a11y/iframe-has-title': 'error',
|
|
98
|
+
'jsx-a11y/img-redundant-alt': 'error',
|
|
99
|
+
'jsx-a11y/interactive-supports-focus': 'warn',
|
|
100
|
+
'jsx-a11y/label-has-associated-control': 'error',
|
|
101
|
+
'jsx-a11y/lang': 'error',
|
|
102
|
+
'jsx-a11y/media-has-caption': 'warn',
|
|
103
|
+
'jsx-a11y/mouse-events-have-key-events': 'error',
|
|
104
|
+
'jsx-a11y/no-access-key': 'error',
|
|
105
|
+
'jsx-a11y/no-aria-hidden-on-focusable': 'warn',
|
|
106
|
+
'jsx-a11y/no-autofocus': 'off',
|
|
107
|
+
'jsx-a11y/no-distracting-elements': 'error',
|
|
108
|
+
'jsx-a11y/no-interactive-element-to-noninteractive-role': 'warn',
|
|
109
|
+
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
|
|
110
|
+
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'warn',
|
|
111
|
+
'jsx-a11y/no-noninteractive-tabindex': 'off',
|
|
112
|
+
'jsx-a11y/no-redundant-roles': 'error',
|
|
113
|
+
'jsx-a11y/no-static-element-interactions': 'off',
|
|
114
|
+
'jsx-a11y/role-has-required-aria-props': 'error',
|
|
115
|
+
'jsx-a11y/role-supports-aria-props': 'error',
|
|
116
|
+
'jsx-a11y/scope': 'error',
|
|
117
|
+
'jsx-a11y/tabindex-no-positive': 'warn',
|
|
118
|
+
'jsx-a11y/anchor-ambiguous-text': 'off',
|
|
119
|
+
'jsx-a11y/prefer-tag-over-role': 'off'
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
module.exports = react;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _eslintPluginStorybook = _interopRequireDefault(require("eslint-plugin-storybook"));
|
|
8
|
+
var _globs = require("../utils/globs.js");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
/** @return { import('eslint').Linter.Config } */
|
|
11
|
+
function storybook() {
|
|
12
|
+
return {
|
|
13
|
+
files: _globs.globs.storybook,
|
|
14
|
+
plugins: {
|
|
15
|
+
storybook: _eslintPluginStorybook.default
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
'storybook/await-interactions': 'error',
|
|
19
|
+
'storybook/context-in-play-function': 'error',
|
|
20
|
+
'storybook/default-exports': 'error',
|
|
21
|
+
'storybook/hierarchy-separator': 'warn',
|
|
22
|
+
'storybook/no-redundant-story-name': 'warn',
|
|
23
|
+
'storybook/no-uninstalled-addons': 'error',
|
|
24
|
+
'storybook/prefer-pascal-case': 'warn',
|
|
25
|
+
'storybook/story-exports': 'error',
|
|
26
|
+
'storybook/use-storybook-expect': 'error',
|
|
27
|
+
'storybook/use-storybook-testing-library': 'error',
|
|
28
|
+
'storybook/csf-component': 'warn',
|
|
29
|
+
'storybook/no-stories-of': 'warn',
|
|
30
|
+
'storybook/no-title-property-in-meta': 'off',
|
|
31
|
+
'storybook/meta-inline-properties': 'off',
|
|
32
|
+
// Conflicts
|
|
33
|
+
'@typescript-eslint/no-confusing-void-expression': 'off',
|
|
34
|
+
'react/jsx-no-useless-fragment': 'off',
|
|
35
|
+
'react-hooks/rules-of-hooks': 'off'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
module.exports = storybook;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
/** @return { Promise<import('eslint').Linter.Config> } */
|
|
8
|
+
function tailwind() {
|
|
9
|
+
return {
|
|
10
|
+
plugins: {
|
|
11
|
+
get tailwindcss() {
|
|
12
|
+
return Promise.resolve().then(() => require('eslint-plugin-tailwindcss'));
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
'tailwindcss/classnames-order': 'warn',
|
|
17
|
+
'tailwindcss/enforces-negative-arbitrary-values': 'warn',
|
|
18
|
+
'tailwindcss/enforces-shorthand': 'warn',
|
|
19
|
+
'tailwindcss/migration-from-tailwind-2': 'warn',
|
|
20
|
+
'tailwindcss/no-arbitrary-value': 'off',
|
|
21
|
+
'tailwindcss/no-custom-classname': 'warn',
|
|
22
|
+
'tailwindcss/no-contradicting-classname': 'error'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
module.exports = tailwind;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _eslintPluginJestFormatting = _interopRequireDefault(require("eslint-plugin-jest-formatting"));
|
|
8
|
+
var _globals = _interopRequireDefault(require("globals"));
|
|
9
|
+
var _conditions = require("../utils/conditions.js");
|
|
10
|
+
var _globs = require("../utils/globs.js");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/**
|
|
13
|
+
* @param { import('../option.d.ts').Options } options
|
|
14
|
+
* @return { import('eslint').Linter.Config }
|
|
15
|
+
*/
|
|
16
|
+
function tests(options = {}) {
|
|
17
|
+
return {
|
|
18
|
+
plugins: {
|
|
19
|
+
'jest-formatting': _eslintPluginJestFormatting.default
|
|
20
|
+
},
|
|
21
|
+
files: [..._globs.globs.test, ..._globs.globs.e2e],
|
|
22
|
+
languageOptions: {
|
|
23
|
+
globals: {
|
|
24
|
+
..._globals.default['shared-node-browser'],
|
|
25
|
+
..._globals.default.jest
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
rules: {
|
|
29
|
+
'jest-formatting/padding-around-after-all-blocks': 'warn',
|
|
30
|
+
'jest-formatting/padding-around-after-each-blocks': 'warn',
|
|
31
|
+
'jest-formatting/padding-around-before-all-blocks': 'warn',
|
|
32
|
+
'jest-formatting/padding-around-before-each-blocks': 'warn',
|
|
33
|
+
'jest-formatting/padding-around-describe-blocks': 'warn',
|
|
34
|
+
'jest-formatting/padding-around-test-blocks': 'warn',
|
|
35
|
+
'max-lines-per-function': 'off',
|
|
36
|
+
'no-sparse-arrays': 'off',
|
|
37
|
+
...(0, _conditions.predicate)(options.fp, {
|
|
38
|
+
'functional/no-let': 'off',
|
|
39
|
+
'functional/no-loop-statements': 'off'
|
|
40
|
+
}),
|
|
41
|
+
...(0, _conditions.predicate)(options.react, {
|
|
42
|
+
'react/jsx-no-constructed-context-values': 'off'
|
|
43
|
+
}),
|
|
44
|
+
...(0, _conditions.predicate)(options.typescript, {
|
|
45
|
+
'@typescript-eslint/method-signature-style': 'off',
|
|
46
|
+
'@typescript-eslint/no-namespace ': 'off',
|
|
47
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
48
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
49
|
+
'@typescript-eslint/no-floating-promises': 'off'
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
module.exports = tests;
|