@fullstacksjs/eslint-config 11.1.17 → 11.1.18

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/cjs/index.js ADDED
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.init = init;
7
+ var _deepmerge = _interopRequireDefault(require("deepmerge"));
8
+ var _localPkg = require("local-pkg");
9
+ var _base = _interopRequireDefault(require("./modules/base.js"));
10
+ var _cypress = _interopRequireDefault(require("./modules/cypress.js"));
11
+ var _functional = _interopRequireDefault(require("./modules/functional.js"));
12
+ var _imports = _interopRequireDefault(require("./modules/imports.js"));
13
+ var _jest = _interopRequireDefault(require("./modules/jest.js"));
14
+ var _next = _interopRequireDefault(require("./modules/next.js"));
15
+ var _node = _interopRequireDefault(require("./modules/node.js"));
16
+ var _perfectionist = _interopRequireDefault(require("./modules/perfectionist.js"));
17
+ var _playwright = _interopRequireDefault(require("./modules/playwright.js"));
18
+ var _prettier = _interopRequireDefault(require("./modules/prettier.js"));
19
+ var _react = _interopRequireDefault(require("./modules/react.js"));
20
+ var _storybook = _interopRequireDefault(require("./modules/storybook.js"));
21
+ var _tailwind = _interopRequireDefault(require("./modules/tailwind.js"));
22
+ var _tests = _interopRequireDefault(require("./modules/tests.js"));
23
+ var _typescript = _interopRequireDefault(require("./modules/typescript.js"));
24
+ var _vitest = _interopRequireDefault(require("./modules/vitest.js"));
25
+ var _compose = require("./utils/compose.js");
26
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
27
+ const testPackages = ['jest', 'vitest', 'cypress', 'playwright'];
28
+
29
+ /** @type {import('./option.d.ts').Options} */
30
+ const defaultOptions = {
31
+ cypress: (0, _localPkg.isPackageExists)('cypress'),
32
+ disableExpensiveRules: false,
33
+ esm: false,
34
+ fp: true,
35
+ ignores: [],
36
+ import: {},
37
+ jest: (0, _localPkg.isPackageExists)('jest'),
38
+ next: (0, _localPkg.isPackageExists)('next'),
39
+ node: false,
40
+ sort: true,
41
+ playwright: (0, _localPkg.isPackageExists)('playwright'),
42
+ prettier: (0, _localPkg.isPackageExists)('prettier'),
43
+ react: (0, _localPkg.isPackageExists)('react'),
44
+ storybook: (0, _localPkg.isPackageExists)('storybook'),
45
+ strict: false,
46
+ tailwind: (0, _localPkg.isPackageExists)('tailwindcss'),
47
+ test: testPackages.some(p => (0, _localPkg.isPackageExists)(p)),
48
+ typescript: (0, _localPkg.isPackageExists)('typescript') ? {
49
+ projects: true
50
+ } : false,
51
+ unocss: (0, _localPkg.isPackageExists)('unocss'),
52
+ vitest: (0, _localPkg.isPackageExists)('vitest')
53
+ };
54
+
55
+ /**
56
+ * Initialize eslint config
57
+ *
58
+ * @param {import('./option.d.ts').Options} initOptions
59
+ * @param {...(import('eslint').Linter.Config)} extend
60
+ * @returns {import('eslint').Linter.Config[]}
61
+ */
62
+ function init(initOptions, ...extend) {
63
+ const options = (0, _deepmerge.default)(defaultOptions, initOptions);
64
+ if (options.typescript === true) {
65
+ options.typescript = {};
66
+ }
67
+ if (options.import === true) {
68
+ options.import = {};
69
+ }
70
+ const rules = [(0, _compose.compose)(_base.default, options)];
71
+ if (options.fp) rules.push((0, _compose.compose)(_functional.default, options));
72
+ if (options.sort) rules.push((0, _compose.compose)(_perfectionist.default, options));
73
+ if (options.import) rules.push((0, _compose.compose)(_imports.default, options));
74
+ if (options.tailwind) rules.push((0, _compose.compose)(_tailwind.default, options));
75
+ if (options.test) rules.push((0, _compose.compose)(_tests.default, options));
76
+ if (options.node) rules.push((0, _compose.compose)(_node.default, options));
77
+ if (options.jest) rules.push((0, _compose.compose)(_jest.default, options));
78
+ if (options.vitest) rules.push((0, _compose.compose)(_vitest.default, options));
79
+ if (options.cypress) rules.push((0, _compose.compose)(_cypress.default, options));
80
+ if (options.react) rules.push((0, _compose.compose)(_react.default, options));
81
+ if (options.storybook) rules.push((0, _compose.compose)(_storybook.default, options));
82
+ if (options.typescript) rules.push((0, _compose.compose)(_typescript.default, options));
83
+ if (options.playwright) rules.push((0, _compose.compose)(_playwright.default, options));
84
+ if (options.next && options.next) rules.push((0, _compose.compose)(_next.default, options));
85
+ if (options.prettier) rules.push((0, _compose.compose)(_prettier.default, options));
86
+ return rules.concat(extend);
87
+ }
@@ -0,0 +1,213 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _globals = _interopRequireDefault(require("globals"));
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 base(options = {}) {
15
+ return {
16
+ languageOptions: {
17
+ ecmaVersion: 'latest',
18
+ sourceType: 'module',
19
+ globals: {
20
+ ..._globals.default.browser,
21
+ ..._globals.default.node,
22
+ ..._globals.default.es2024
23
+ },
24
+ parserOptions: {
25
+ ecmaVersion: 'latest',
26
+ ecmaFeatures: {
27
+ jsx: true
28
+ }
29
+ }
30
+ },
31
+ rules: {
32
+ 'accessor-pairs': 'error',
33
+ 'array-callback-return': 'error',
34
+ 'block-scoped-var': 'error',
35
+ 'camelcase': ['warn', {
36
+ properties: 'always'
37
+ }],
38
+ 'complexity': ['error', 14],
39
+ 'constructor-super': 'error',
40
+ 'default-case-last': 'error',
41
+ 'default-case': 'error',
42
+ 'default-param-last': 'warn',
43
+ 'dot-notation': 'error',
44
+ 'eqeqeq': ['error', 'smart'],
45
+ 'for-direction': 'error',
46
+ 'func-name-matching': 'error',
47
+ 'func-names': 'error',
48
+ 'getter-return': ['error', {
49
+ allowImplicit: true
50
+ }],
51
+ 'guard-for-in': 'error',
52
+ 'max-depth': ['error', 4],
53
+ 'max-lines-per-function': ['error', 150],
54
+ 'max-lines': ['error', {
55
+ max: 2500,
56
+ skipBlankLines: false,
57
+ skipComments: false
58
+ }],
59
+ 'max-nested-callbacks': ['error', 7],
60
+ 'max-params': ['error', 7],
61
+ 'max-statements': ['error', 40],
62
+ 'no-alert': 'error',
63
+ 'no-array-constructor': 'error',
64
+ 'no-await-in-loop': 'error',
65
+ 'no-bitwise': 'error',
66
+ 'no-caller': 'error',
67
+ 'no-case-declarations': 'error',
68
+ 'no-class-assign': 'error',
69
+ 'no-compare-neg-zero': 'error',
70
+ 'no-cond-assign': 'error',
71
+ 'no-const-assign': 'error',
72
+ 'no-constant-binary-expression': 'warn',
73
+ 'no-constant-condition': 'error',
74
+ 'no-constructor-return': 'error',
75
+ 'no-control-regex': 'error',
76
+ 'no-debugger': 'error',
77
+ 'no-delete-var': 'error',
78
+ 'no-div-regex': 'error',
79
+ 'no-dupe-args': 'error',
80
+ 'no-dupe-class-members': 'error',
81
+ 'no-dupe-else-if': 'error',
82
+ 'no-dupe-keys': 'error',
83
+ 'no-duplicate-case': 'error',
84
+ 'no-empty-character-class': 'error',
85
+ 'no-empty-function': 'warn',
86
+ 'no-empty-pattern': 'error',
87
+ 'no-empty-static-block': 'warn',
88
+ 'no-empty': 'error',
89
+ 'no-eval': 'error',
90
+ 'no-ex-assign': 'error',
91
+ 'no-extend-native': 'error',
92
+ 'no-extra-bind': 'error',
93
+ 'no-extra-label': 'error',
94
+ 'no-fallthrough': 'error',
95
+ 'no-func-assign': 'error',
96
+ 'no-global-assign': 'error',
97
+ 'no-implicit-globals': 'error',
98
+ 'no-implied-eval': 'error',
99
+ 'no-import-assign': 'error',
100
+ 'no-inner-declarations': 'error',
101
+ 'no-invalid-regexp': 'error',
102
+ 'no-invalid-this': 'warn',
103
+ 'no-irregular-whitespace': 'error',
104
+ 'no-iterator': 'error',
105
+ 'no-label-var': 'error',
106
+ 'no-labels': 'error',
107
+ 'no-lone-blocks': 'error',
108
+ 'no-lonely-if': 'error',
109
+ 'no-loop-func': 'error',
110
+ 'no-loss-of-precision': 'warn',
111
+ 'no-multi-assign': 'error',
112
+ 'no-multi-str': 'error',
113
+ 'no-new-func': 'error',
114
+ 'no-new-native-nonconstructor': 'error',
115
+ 'no-new-wrappers': 'error',
116
+ 'no-new': 'error',
117
+ 'no-nonoctal-decimal-escape': 'error',
118
+ 'no-obj-calls': 'error',
119
+ 'no-object-constructor': 'error',
120
+ 'no-octal-escape': 'error',
121
+ 'no-octal': 'error',
122
+ 'no-promise-executor-return': 'error',
123
+ 'no-proto': 'error',
124
+ 'no-redeclare': 'error',
125
+ 'no-regex-spaces': 'error',
126
+ 'no-restricted-globals': ['error', {
127
+ name: 'event',
128
+ message: 'Use local parameter instead.'
129
+ }],
130
+ 'no-restricted-syntax': ['error', 'WithStatement'],
131
+ 'no-return-assign': 'error',
132
+ 'no-return-await': 'warn',
133
+ 'no-script-url': 'error',
134
+ 'no-self-assign': 'error',
135
+ 'no-self-compare': 'error',
136
+ 'no-sequences': 'error',
137
+ 'no-setter-return': 'error',
138
+ 'no-shadow-restricted-names': 'error',
139
+ 'no-shadow': 'error',
140
+ 'no-sparse-arrays': 'error',
141
+ 'no-this-before-super': 'error',
142
+ 'no-throw-literal': 'error',
143
+ 'no-undef-init': 'error',
144
+ 'no-undef': 'error',
145
+ 'no-unexpected-multiline': 'error',
146
+ 'no-unmodified-loop-condition': 'error',
147
+ 'no-unneeded-ternary': 'error',
148
+ 'no-unreachable-loop': 'error',
149
+ 'no-unreachable': 'error',
150
+ 'no-unsafe-finally': 'error',
151
+ 'no-unsafe-negation': 'error',
152
+ 'no-unsafe-optional-chaining': 'error',
153
+ 'no-unused-labels': 'error',
154
+ 'no-unused-private-class-members': 'warn',
155
+ 'no-unused-vars': ['error', {
156
+ argsIgnorePattern: '^_',
157
+ varsIgnorePattern: '^ignore(d)?',
158
+ args: 'after-used',
159
+ ignoreRestSiblings: true
160
+ }],
161
+ 'no-use-before-define': ['error', 'nofunc'],
162
+ 'no-useless-backreference': 'error',
163
+ 'no-useless-call': 'error',
164
+ 'no-useless-catch': 'error',
165
+ 'no-useless-computed-key': 'error',
166
+ 'no-useless-concat': 'error',
167
+ 'no-useless-constructor': 'error',
168
+ 'no-useless-escape': 'error',
169
+ 'no-useless-rename': 'error',
170
+ 'no-useless-return': 'error',
171
+ 'no-var': 'warn',
172
+ 'no-warning-comments': ['warn', {
173
+ terms: ['fixme'],
174
+ location: 'anywhere'
175
+ }],
176
+ 'object-shorthand': ['error', 'properties'],
177
+ 'one-var': ['error', {
178
+ uninitialized: 'never',
179
+ initialized: 'never'
180
+ }],
181
+ 'prefer-arrow-callback': ['warn', {
182
+ allowNamedFunctions: true,
183
+ allowUnboundThis: true
184
+ }],
185
+ 'prefer-const': 'warn',
186
+ 'prefer-exponentiation-operator': 'warn',
187
+ 'prefer-numeric-literals': 'error',
188
+ 'prefer-object-has-own': 'warn',
189
+ 'prefer-rest-params': 'error',
190
+ 'prefer-spread': 'error',
191
+ 'prefer-template': 'error',
192
+ 'radix': 'error',
193
+ 'require-await': 'error',
194
+ 'require-yield': 'error',
195
+ 'strict': 'error',
196
+ 'symbol-description': 'error',
197
+ 'use-isnan': 'error',
198
+ 'valid-typeof': 'error',
199
+ 'vars-on-top': 'error',
200
+ 'yoda': 'error',
201
+ 'require-atomic-updates': 'warn',
202
+ 'no-async-promise-executor': 'warn',
203
+ 'grouped-accessor-pairs': 'warn',
204
+ 'no-extra-boolean-cast': 'warn',
205
+ 'no-param-reassign': 'warn',
206
+ 'prefer-regex-literals': ['warn', {
207
+ disallowRedundantWrapping: true
208
+ }],
209
+ 'no-console': (0, _conditions.strict)(options, 'warn')
210
+ }
211
+ };
212
+ }
213
+ module.exports = base;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _flat = _interopRequireDefault(require("eslint-plugin-cypress/flat"));
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 cypress() {
12
+ return {
13
+ files: _globs.globs.e2e,
14
+ plugins: {
15
+ cypress: _flat.default
16
+ },
17
+ rules: {
18
+ 'cypress/assertion-before-screenshot': 'warn',
19
+ 'cypress/no-assigning-return-values': 'error',
20
+ 'cypress/no-async-tests': 'error',
21
+ 'cypress/no-force': 'warn',
22
+ 'cypress/no-pause': 'error',
23
+ 'cypress/no-unnecessary-waiting': 'error',
24
+ 'cypress/require-data-selectors': 'off',
25
+ 'cypress/unsafe-to-chain-command': 'error',
26
+ '@typescript-eslint/no-namespace': 'off'
27
+ }
28
+ };
29
+ }
30
+ module.exports = cypress;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _eslintPluginFunctional = _interopRequireDefault(require("eslint-plugin-functional"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ /**
10
+ * @param { import('../option').Options } options
11
+ * @return { import('eslint').Linter.Config }
12
+ */
13
+ function fp() {
14
+ return {
15
+ plugins: {
16
+ functional: _eslintPluginFunctional.default
17
+ },
18
+ rules: {
19
+ 'functional/functional-parameters': 'off',
20
+ 'functional/no-let': ['error', {
21
+ allowInForLoopInit: true
22
+ }],
23
+ 'functional/no-loop-statements': 'error'
24
+ }
25
+ };
26
+ }
27
+ module.exports = fp;
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _eslintPluginImportX = _interopRequireDefault(require("eslint-plugin-import-x"));
8
+ var _conditions = require("../utils/conditions.js");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const tsExtensions = ['.ts', '.tsx', '.cts', '.mts', '.ctsx', '.mtsx'];
11
+ const jsExtensions = ['.mjs', '.js', '.jsx', '.cjs'];
12
+ const allExtensions = [...jsExtensions, ...tsExtensions];
13
+
14
+ /**
15
+ * @param { import('../option.d.ts').Options } options
16
+ * @return { import('eslint').Linter.Config }
17
+ */
18
+ function imports(options = {}) {
19
+ const isObject = typeof options.import === 'object';
20
+ const ignoreExtensions = {};
21
+ if (!options.esm) {
22
+ ignoreExtensions.js = 'never';
23
+ ignoreExtensions.jsx = 'never';
24
+ if (options.typescript) {
25
+ ignoreExtensions.ts = 'never';
26
+ ignoreExtensions.tsx = 'never';
27
+ }
28
+ }
29
+ const config = {
30
+ plugins: {
31
+ import: _eslintPluginImportX.default
32
+ },
33
+ settings: {
34
+ 'import-x/extensions': jsExtensions,
35
+ 'import-x/external-module-folders': ['node_modules', 'node_modules/@types'],
36
+ 'import-x/ignore': ['node_modules', '\\.(scss|css|svg|json)$'],
37
+ ...(0, _conditions.predicate)(options.typescript, {
38
+ 'import-x/resolver': {
39
+ typescript: true
40
+ },
41
+ 'import-x/parsers': {
42
+ '@typescript-eslint/parser': tsExtensions
43
+ },
44
+ 'import-x/extensions': allExtensions
45
+ }),
46
+ ...(0, _conditions.predicate)(isObject && 'internalRegExp' in options.import, {
47
+ 'import-x/internal-regex': options.import.internalRegExp
48
+ }),
49
+ ...(0, _conditions.predicate)(isObject && 'lifetime' in options.import, {
50
+ 'import-x/cache': {
51
+ lifetime: options.import.lifetime
52
+ }
53
+ })
54
+ },
55
+ rules: {
56
+ 'import/consistent-type-specifier-style': ['warn', 'prefer-top-level'],
57
+ 'import/extensions': ['error', 'ignorePackages', ignoreExtensions],
58
+ 'import/first': 'error',
59
+ 'import/newline-after-import': 'warn',
60
+ 'import/no-absolute-path': 'error',
61
+ 'import/no-amd': 'error',
62
+ 'import/no-duplicates': 'error',
63
+ 'import/no-empty-named-blocks': 'error',
64
+ 'import/no-extraneous-dependencies': ['error', {
65
+ devDependencies: true
66
+ }],
67
+ 'import/no-mutable-exports': 'error',
68
+ 'import/no-named-as-default': 'error',
69
+ 'import/no-named-default': 'error',
70
+ 'import/no-relative-packages': 'error',
71
+ 'import/no-self-import': 'error',
72
+ 'import/no-unresolved': ['error', {
73
+ caseSensitiveStrict: true
74
+ }],
75
+ 'import/no-useless-path-segments': 'warn',
76
+ 'import/no-webpack-loader-syntax': 'error',
77
+ 'import/order': 'off',
78
+ ...(0, _conditions.predicate)(!options.disableExpensiveRules, {
79
+ 'import/default': 'error',
80
+ 'import/export': 'error',
81
+ 'import/named': 'error',
82
+ 'import/namespace': 'error',
83
+ 'import/no-cycle': ['error', {
84
+ maxDepth: Infinity
85
+ }],
86
+ 'import/no-deprecated': 'warn',
87
+ 'import/no-named-as-default-member': 'error'
88
+ }),
89
+ 'import/dynamic-import-chunkname': 'off',
90
+ 'import/exports-last': 'off',
91
+ 'import/group-exports': 'off',
92
+ 'import/max-dependencies': 'off',
93
+ 'import/no-anonymous-default-export': 'off',
94
+ 'import/no-commonjs': 'off',
95
+ 'import/no-default-export': 'off',
96
+ 'import/no-dynamic-require': 'off',
97
+ 'import/no-import-module-exports': 'off',
98
+ 'import/no-internal-modules': 'off',
99
+ 'import/no-named-export': 'off',
100
+ 'import/no-namespace': 'off',
101
+ 'import/no-nodejs-modules': 'off',
102
+ 'import/no-relative-parent-imports': 'off',
103
+ 'import/no-restricted-paths': 'off',
104
+ 'import/no-unassigned-import': 'off',
105
+ 'import/no-unused-modules': 'off',
106
+ 'import/prefer-default-export': 'off',
107
+ 'import/unambiguous': 'off'
108
+ }
109
+ };
110
+ return config;
111
+ }
112
+ module.exports = imports;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _eslintPluginJest = _interopRequireDefault(require("eslint-plugin-jest"));
8
+ var _globs = require("../utils/globs.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
+ function jest() {
14
+ return {
15
+ files: _globs.globs.test,
16
+ plugins: {
17
+ jest: _eslintPluginJest.default
18
+ },
19
+ rules: {
20
+ 'jest/consistent-test-it': 'off',
21
+ 'jest/expect-expect': 'off',
22
+ 'jest/lowercase-name': 'off',
23
+ 'jest/max-nested-describe': ['error', {
24
+ max: 2
25
+ }],
26
+ 'jest/no-alias-methods': 'error',
27
+ 'jest/no-commented-out-tests': 'warn',
28
+ 'jest/no-conditional-expect': 'error',
29
+ 'jest/no-conditional-in-test': 'error',
30
+ 'jest/no-confusing-set-timeout': 'warn',
31
+ 'jest/no-done-callback': 'warn',
32
+ 'jest/no-expect-resolves': 'off',
33
+ 'jest/no-export': 'error',
34
+ 'jest/no-hooks': 'off',
35
+ 'jest/no-interpolation-in-snapshots': 'error',
36
+ 'jest/no-jasmine-globals': 'off',
37
+ 'jest/no-large-snapshots': ['warn', {
38
+ maxSize: 300
39
+ }],
40
+ 'jest/no-mocks-import': 'error',
41
+ 'jest/no-restricted-jest-methods': 'off',
42
+ 'jest/no-restricted-matchers': 'error',
43
+ 'jest/no-standalone-expect': 'off',
44
+ 'jest/no-test-callback': 'off',
45
+ 'jest/no-test-prefixes': 'error',
46
+ 'jest/no-test-return-statement': 'off',
47
+ 'jest/no-truthy-falsy': 'off',
48
+ 'jest/prefer-called-with': 'error',
49
+ 'jest/prefer-each': 'warn',
50
+ 'jest/prefer-expect-assertions': 'off',
51
+ 'jest/prefer-expect-resolves': 'warn',
52
+ 'jest/prefer-hooks-on-top': 'error',
53
+ 'jest/prefer-inline-snapshots': 'off',
54
+ 'jest/prefer-lowercase-title': 'off',
55
+ 'jest/prefer-mock-promise-shorthand': 'warn',
56
+ 'jest/prefer-snapshot-hint': 'warn',
57
+ 'jest/prefer-spy-on': 'off',
58
+ 'jest/prefer-strict-equal': 'off',
59
+ 'jest/prefer-to-be-null': 'off',
60
+ 'jest/prefer-to-be-undefined': 'off',
61
+ 'jest/prefer-to-be': 'warn',
62
+ 'jest/prefer-to-contain': 'warn',
63
+ 'jest/prefer-to-have-length': 'warn',
64
+ 'jest/prefer-todo': 'warn',
65
+ 'jest/require-hook': 'off',
66
+ 'jest/require-to-throw-message': 'off',
67
+ 'jest/require-top-level-describe': 'off',
68
+ 'jest/valid-describe-callback': 'error',
69
+ 'jest/valid-expect-in-promise': 'error',
70
+ 'jest/valid-expect': 'error',
71
+ 'jest/valid-title': 'warn',
72
+ 'jest/no-deprecated-functions': 'error'
73
+
74
+ // ...predicate(options.typescript, {
75
+ // '@typescript-eslint/unbound-method': 'off',
76
+ // 'jest/unbound-method': 'error',
77
+ // 'jest/no-untyped-mock-factory': 'warn',
78
+ // }),
79
+ }
80
+ };
81
+ }
82
+ module.exports = jest;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _eslintPluginNext = _interopRequireDefault(require("@next/eslint-plugin-next"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ /** @type { import('eslint').Linter.Config } */
10
+ function next() {
11
+ return {
12
+ plugins: {
13
+ next: _eslintPluginNext.default
14
+ },
15
+ rules: {
16
+ 'next/google-font-display': 'warn',
17
+ 'next/google-font-preconnect': 'warn',
18
+ 'next/inline-script-id': 'warn',
19
+ 'next/next-script-for-ga': 'warn',
20
+ 'next/no-assign-module-variable': 'warn',
21
+ 'next/no-async-client-component': 'warn',
22
+ 'next/no-before-interactive-script-outside-document': 'warn',
23
+ 'next/no-css-tags': 'warn',
24
+ 'next/no-document-import-in-page': 'warn',
25
+ // 'next/no-duplicate-head': 'warn',
26
+ 'next/no-head-element': 'warn',
27
+ 'next/no-head-import-in-document': 'warn',
28
+ 'next/no-html-link-for-pages': 'warn',
29
+ 'next/no-img-element': 'warn',
30
+ 'next/no-page-custom-font': 'warn',
31
+ 'next/no-script-component-in-head': 'warn',
32
+ 'next/no-styled-jsx-in-document': 'warn',
33
+ 'next/no-sync-scripts': 'warn',
34
+ 'next/no-title-in-document-head': 'warn',
35
+ 'next/no-typos': 'warn',
36
+ 'next/no-unwanted-polyfillio': 'warn'
37
+ }
38
+ };
39
+ }
40
+ module.exports = next;
@@ -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;