@nice-move/eslint-config-base 0.8.5 → 0.8.6

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/lib/import.cjs CHANGED
@@ -69,13 +69,6 @@ module.exports = {
69
69
  },
70
70
  }),
71
71
  ),
72
- {
73
- files: '**/*',
74
- excludedFiles: ['*.cjs'],
75
- rules: {
76
- 'import/no-commonjs': 'error',
77
- },
78
- },
79
72
  {
80
73
  files: '**/*.*',
81
74
  excludedFiles: '*.{m,c}js',
package/lib/node.cjs CHANGED
@@ -1,5 +1,13 @@
1
1
  'use strict';
2
2
 
3
+ const { configHas } = require('./utils.cjs');
4
+
5
+ const commonjs =
6
+ configHas(
7
+ ({ commonjs = [] }) => commonjs,
8
+ (commonjs) => commonjs,
9
+ ) || [];
10
+
3
11
  module.exports = {
4
12
  plugins: ['n'],
5
13
  rules: {
@@ -8,6 +16,13 @@ module.exports = {
8
16
  'n/no-path-concat': 'error',
9
17
  },
10
18
  overrides: [
19
+ {
20
+ files: '**/*',
21
+ excludedFiles: ['*.cjs', ...commonjs],
22
+ rules: {
23
+ 'import/no-commonjs': 'error',
24
+ },
25
+ },
11
26
  {
12
27
  files: '*.nb.*',
13
28
  env: {
@@ -24,7 +39,7 @@ module.exports = {
24
39
  },
25
40
  },
26
41
  {
27
- files: '*.{m,c}js',
42
+ files: ['*.{m,c}js', ...commonjs],
28
43
  excludedFiles: '*.nb.*',
29
44
  env: {
30
45
  browser: false,
@@ -55,6 +70,7 @@ module.exports = {
55
70
  '*.nb.*',
56
71
  '*.ts',
57
72
  '**/*.md/*',
73
+ ...commonjs,
58
74
  ],
59
75
  rules: {
60
76
  'n/file-extension-in-import': 'error',
@@ -82,7 +98,7 @@ module.exports = {
82
98
  },
83
99
  },
84
100
  {
85
- files: '*.cjs',
101
+ files: ['*.cjs', ...commonjs],
86
102
  excludedFiles: '*.nb.*',
87
103
  parserOptions: {
88
104
  ecmaFeatures: {
@@ -94,6 +110,7 @@ module.exports = {
94
110
  strict: ['error', 'global'],
95
111
  'n/no-exports-assign': 'error',
96
112
  'n/no-new-require': 'error',
113
+ 'unicorn/prefer-module': 'off',
97
114
  },
98
115
  },
99
116
  ],
package/lib/unicorn.cjs CHANGED
@@ -23,12 +23,4 @@ module.exports = {
23
23
  'unicorn/require-post-message-target-origin': 'off',
24
24
  'unicorn/template-indent': 'off',
25
25
  },
26
- overrides: [
27
- {
28
- files: '*.cjs',
29
- rules: {
30
- 'unicorn/prefer-module': 'off',
31
- },
32
- },
33
- ],
34
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-move/eslint-config-base",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "A `eslint` config for best practice",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -59,4 +59,4 @@
59
59
  "access": "public",
60
60
  "registry": "https://registry.npmjs.org/"
61
61
  }
62
- }
62
+ }