@fullstacksjs/eslint-config 10.6.0 → 10.6.2

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.
@@ -1,13 +1,4 @@
1
- /** @type { import('eslint').Linter.Config } */
2
- module.exports = {
3
- rules: {
4
- '@typescript-eslint/no-misused-promises': 'off',
5
- 'prettier/prettier': 'off',
6
- 'import/no-cycle': 'off',
7
- 'import/namespace': 'off',
8
- 'import/no-deprecated': 'off',
9
- 'import/named': 'off',
10
- 'import/export': 'off',
11
- '@typescript-eslint/no-floating-promises': 'off',
12
- },
1
+ module.exports = config => {
2
+ if (global.fullstacksjs?.disableExpensiveRules) return 'off';
3
+ return config;
13
4
  };
package/import.js CHANGED
@@ -1,3 +1,5 @@
1
+ const expensiveRules = require('./expensive-rules');
2
+
1
3
  /** @type { import('eslint').Linter.Config } */
2
4
  module.exports = {
3
5
  plugins: ['import', 'simple-import-sort'],
@@ -14,22 +16,22 @@ module.exports = {
14
16
  'import/consistent-type-specifier-style': ['warn', 'prefer-top-level'],
15
17
  'import/default': 'error',
16
18
  'import/dynamic-import-chunkname': 'off',
17
- 'import/export': 'error',
19
+ 'import/export': expensiveRules('error'),
18
20
  'import/exports-last': 'off',
19
21
  'import/extensions': ['error', 'always', { js: 'never', jsx: 'never', ts: 'never', tsx: 'never' }],
20
22
  'import/first': 'error',
21
23
  'import/group-exports': 'off',
22
24
  'import/max-dependencies': ['off', { ignoreTypeImports: true }],
23
- 'import/named': 'error',
24
- 'import/namespace': 'error',
25
+ 'import/named': expensiveRules('error'),
26
+ 'import/namespace': expensiveRules('error'),
25
27
  'import/newline-after-import': 'warn',
26
28
  'import/no-absolute-path': 'error',
27
29
  'import/no-amd': 'error',
28
30
  'import/no-anonymous-default-export': 'off',
29
31
  'import/no-commonjs': 'off',
30
- 'import/no-cycle': ['error', { maxDepth: Infinity }],
32
+ 'import/no-cycle': expensiveRules(['error', { maxDepth: Infinity }]),
31
33
  'import/no-default-export': 'off',
32
- 'import/no-deprecated': 'warn',
34
+ 'import/no-deprecated': expensiveRules('warn'),
33
35
  'import/no-duplicates': 'error',
34
36
  'import/no-dynamic-require': 'off',
35
37
  'import/no-empty-named-blocks': 'error',
package/init.js CHANGED
@@ -19,7 +19,6 @@ function init(opts = {}) {
19
19
  require.resolve('./base'),
20
20
  require.resolve('./promise'),
21
21
  require.resolve('./fp'),
22
- opts.cspell && require.resolve('./cspell'),
23
22
  opts.tailwind && require.resolve('./tailwind'),
24
23
  opts.node && require.resolve('./node'),
25
24
  opts.graphql && require.resolve('./graphql'),
@@ -32,8 +31,8 @@ function init(opts = {}) {
32
31
  opts.test && require.resolve('./jest'),
33
32
  opts.esm && require.resolve('./esm'),
34
33
  opts.strict && require.resolve('./strict'),
35
- opts.prettier && require.resolve('./prettier'),
36
- opts.disableExpensiveRules && require.resolve('./expensive-rules'),
34
+ !opts.disableExpensiveRules && opts.prettier && require.resolve('./prettier'),
35
+ !opts.disableExpensiveRules && opts.cspell && require.resolve('./cspell'),
37
36
  ]
38
37
  .concat(extraExtends)
39
38
  .filter(Boolean),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "10.6.0",
3
+ "version": "10.6.2",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
package/typecheck.js CHANGED
@@ -1,3 +1,5 @@
1
+ const expensiveRules = require('./expensive-rules');
2
+
1
3
  /** @type { import('eslint').Linter.Config } */
2
4
  module.exports = {
3
5
  overrides: [
@@ -17,11 +19,11 @@ module.exports = {
17
19
  '@typescript-eslint/no-confusing-void-expression': ['off', { ignoreArrowShorthand: true, ignoreVoidOperator: true }], // Annoying and conflict with @typescript-eslint/no-meaningless-void-operator
18
20
  '@typescript-eslint/no-duplicate-type-constituents': 'warn',
19
21
  '@typescript-eslint/no-unsafe-enum-comparison': 'warn',
20
- '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
22
+ '@typescript-eslint/no-floating-promises': expensiveRules(['error', { ignoreVoid: true }]),
21
23
  '@typescript-eslint/no-for-in-array': 'error',
22
24
  '@typescript-eslint/no-implied-eval': 'error',
23
25
  '@typescript-eslint/no-meaningless-void-operator': ['warn', { checkNever: false }],
24
- '@typescript-eslint/no-misused-promises': ['warn', { checksVoidReturn: { attributes: false } }],
26
+ '@typescript-eslint/no-misused-promises': expensiveRules(['warn', { checksVoidReturn: { attributes: false } }]),
25
27
  '@typescript-eslint/no-mixed-enums': 'error',
26
28
  '@typescript-eslint/no-redundant-type-constituents': 'warn',
27
29
  '@typescript-eslint/no-throw-literal': ['warn', { allowThrowingUnknown: false }],