@dword-design/eslint-config 5.0.23 → 5.0.25
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/dist/create/index.js +15 -5
- package/package.json +2 -1
package/dist/create/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import defu from '@dword-design/defu';
|
|
1
2
|
import { compact, filter, join, map, omit } from '@dword-design/functions';
|
|
2
3
|
import confusingBrowserGlobals from 'confusing-browser-globals';
|
|
3
4
|
import packageName from 'depcheck-package-name';
|
|
@@ -8,7 +9,9 @@ import restrictedImports from "./restricted-imports.js";
|
|
|
8
9
|
export default () => {
|
|
9
10
|
var _ref, _restrictedImports;
|
|
10
11
|
const packageConfig = loadPkg.sync() || {};
|
|
11
|
-
const baseConfig = fs.existsSync('.baserc.json') ? fs.readJsonSync('.baserc.json') : {}
|
|
12
|
+
const baseConfig = defu(fs.existsSync('.baserc.json') ? fs.readJsonSync('.baserc.json') : {}, {
|
|
13
|
+
testRunner: 'mocha'
|
|
14
|
+
});
|
|
12
15
|
const eslintRestrictedImports = (_ref = (_restrictedImports = restrictedImports, filter(importDef => importDef.alternative === undefined || importDef.alternative !== packageConfig.name)(_restrictedImports)), map(importDef => {
|
|
13
16
|
var _importDef, _ref2, _ref3;
|
|
14
17
|
return {
|
|
@@ -25,16 +28,22 @@ export default () => {
|
|
|
25
28
|
},
|
|
26
29
|
overrides: [{
|
|
27
30
|
files: '**/*.spec.js',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
...(baseConfig.testRunner === 'mocha' && {
|
|
32
|
+
globals: {
|
|
33
|
+
expect: 'readonly'
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
31
36
|
rules: {
|
|
32
37
|
'no-restricted-imports': ['error', {
|
|
33
38
|
paths: [...eslintRestrictedImports, {
|
|
34
39
|
message: "Use the global 'expect' variable instead",
|
|
35
40
|
name: 'expect'
|
|
36
41
|
}]
|
|
37
|
-
}]
|
|
42
|
+
}]
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
files: [...(baseConfig.testRunner === 'playwright' ? ['fixtures/**'] : []), '**/*.spec.js'],
|
|
46
|
+
rules: {
|
|
38
47
|
...(baseConfig.testRunner === 'playwright' && {
|
|
39
48
|
'no-empty-pattern': 'off'
|
|
40
49
|
})
|
|
@@ -77,6 +86,7 @@ export default () => {
|
|
|
77
86
|
checkLoops: false
|
|
78
87
|
}],
|
|
79
88
|
'no-continue': 'off',
|
|
89
|
+
'no-empty-pattern': 'error',
|
|
80
90
|
'no-lonely-if': 'off',
|
|
81
91
|
'no-negated-condition': 'error',
|
|
82
92
|
'no-nested-ternary': 'off',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/eslint-config",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.25",
|
|
4
4
|
"repository": "dword-design/eslint-config",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/eslint-parser": "^7.13.14",
|
|
25
|
+
"@dword-design/defu": "^1.0.0",
|
|
25
26
|
"@dword-design/eslint-plugin-import-alias": "^5.0.0",
|
|
26
27
|
"@dword-design/functions": "^6.0.0",
|
|
27
28
|
"confusing-browser-globals": "^1.0.11",
|