@dword-design/eslint-config 3.0.13 → 3.0.15
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/cjs-fallback.cjs +4 -0
- package/dist/create/index.js +24 -30
- package/dist/create/restricted-imports.js +2 -10
- package/dist/index.js +2 -11
- package/package.json +6 -2
package/dist/create/index.js
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _depcheckPackageName = _interopRequireDefault(require("depcheck-package-name"));
|
|
13
|
-
var _loadPkg = _interopRequireDefault(require("load-pkg"));
|
|
14
|
-
var _restrictedImports2 = _interopRequireDefault(require("./restricted-imports"));
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
var _default = () => {
|
|
1
|
+
import compact from "@dword-design/functions/dist/compact.js";
|
|
2
|
+
import filter from "@dword-design/functions/dist/filter.js";
|
|
3
|
+
import join from "@dword-design/functions/dist/join.js";
|
|
4
|
+
import map from "@dword-design/functions/dist/map.js";
|
|
5
|
+
import omit from "@dword-design/functions/dist/omit.js";
|
|
6
|
+
import packageName from 'depcheck-package-name';
|
|
7
|
+
import loadPkg from 'load-pkg';
|
|
8
|
+
import { createRequire } from 'module';
|
|
9
|
+
import restrictedImports from "./restricted-imports.js";
|
|
10
|
+
const _require = createRequire(import.meta.url);
|
|
11
|
+
export default (() => {
|
|
17
12
|
var _ref, _restrictedImports;
|
|
18
|
-
const packageConfig =
|
|
19
|
-
const eslintRestrictedImports = (_ref = (_restrictedImports =
|
|
13
|
+
const packageConfig = loadPkg.sync() || {};
|
|
14
|
+
const eslintRestrictedImports = (_ref = (_restrictedImports = restrictedImports, filter(importDef => importDef.alternative === undefined || importDef.alternative !== packageConfig.name)(_restrictedImports)), map(importDef => {
|
|
20
15
|
var _importDef, _ref2, _ref3;
|
|
21
16
|
return {
|
|
22
|
-
...(_importDef = importDef, (
|
|
23
|
-
message: (_ref2 = (_ref3 = [importDef.message, importDef.alternative ? `Use '${importDef.alternative}' instead` : ''], (
|
|
17
|
+
...(_importDef = importDef, omit(['alternative'])(_importDef)),
|
|
18
|
+
message: (_ref2 = (_ref3 = [importDef.message, importDef.alternative ? `Use '${importDef.alternative}' instead` : ''], compact(_ref3)), join(' ')(_ref2))
|
|
24
19
|
};
|
|
25
20
|
})(_ref));
|
|
26
21
|
return {
|
|
@@ -29,7 +24,7 @@ var _default = () => {
|
|
|
29
24
|
es6: true,
|
|
30
25
|
node: true
|
|
31
26
|
},
|
|
32
|
-
extends: [
|
|
27
|
+
extends: [packageName`eslint-config-airbnb-base`, `plugin:${packageName`eslint-plugin-promise`}/recommended`, `plugin:${packageName`eslint-plugin-import`}/recommended`, `plugin:${packageName`@dword-design/eslint-plugin-import-alias`}/recommended`, `plugin:${packageName`eslint-plugin-vue`}/recommended`, `plugin:${packageName`eslint-plugin-prettier`}/recommended`],
|
|
33
28
|
overrides: [{
|
|
34
29
|
files: '**/*.spec.js',
|
|
35
30
|
globals: {
|
|
@@ -44,14 +39,14 @@ var _default = () => {
|
|
|
44
39
|
}]
|
|
45
40
|
}
|
|
46
41
|
}],
|
|
47
|
-
parser:
|
|
42
|
+
parser: packageName`vue-eslint-parser`,
|
|
48
43
|
parserOptions: {
|
|
49
44
|
babelOptions: {
|
|
50
|
-
configFile:
|
|
45
|
+
configFile: _require.resolve(packageName`@dword-design/babel-config`)
|
|
51
46
|
},
|
|
52
|
-
parser:
|
|
47
|
+
parser: packageName`@babel/eslint-parser`
|
|
53
48
|
},
|
|
54
|
-
plugins: [
|
|
49
|
+
plugins: [packageName`eslint-plugin-prefer-arrow`, packageName`eslint-plugin-simple-import-sort`, packageName`eslint-plugin-json-format`, packageName`eslint-plugin-sort-keys-fix`, packageName`eslint-plugin-react`, packageName`eslint-plugin-github`, packageName`eslint-plugin-node`, packageName`eslint-plugin-unicorn`],
|
|
55
50
|
rules: {
|
|
56
51
|
'arrow-body-style': ['error', 'as-needed'],
|
|
57
52
|
'func-names': ['error', 'never'],
|
|
@@ -131,12 +126,11 @@ var _default = () => {
|
|
|
131
126
|
},
|
|
132
127
|
settings: {
|
|
133
128
|
'import/resolver': {
|
|
134
|
-
[
|
|
129
|
+
[packageName`eslint-import-resolver-babel-module`]: {
|
|
135
130
|
allowExistingDirectories: true
|
|
136
|
-
}
|
|
131
|
+
},
|
|
132
|
+
[packageName`eslint-import-resolver-exports`]: {}
|
|
137
133
|
}
|
|
138
134
|
}
|
|
139
135
|
};
|
|
140
|
-
};
|
|
141
|
-
exports.default = _default;
|
|
142
|
-
module.exports = exports.default;
|
|
136
|
+
});
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = [{
|
|
1
|
+
export default [{
|
|
8
2
|
alternative: 'parse-packagejson-name',
|
|
9
3
|
message: 'Does not work in the browser due to fs dependency in ow.',
|
|
10
4
|
name: 'parse-pkg-name'
|
|
@@ -75,6 +69,4 @@ var _default = [{
|
|
|
75
69
|
importNames: ['zipObject'],
|
|
76
70
|
message: 'Use map and fromPairs instead',
|
|
77
71
|
name: '@dword-design/functions'
|
|
78
|
-
}];
|
|
79
|
-
exports.default = _default;
|
|
80
|
-
module.exports = exports.default;
|
|
72
|
+
}];
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _create = _interopRequireDefault(require("./create"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = (0, _create.default)();
|
|
10
|
-
exports.default = _default;
|
|
11
|
-
module.exports = exports.default;
|
|
1
|
+
import create from "./create/index.js";
|
|
2
|
+
export default create();
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/eslint-config",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.15",
|
|
4
4
|
"repository": "dword-design/eslint-config",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Sebastian Landwehr <info@sebastianlandwehr.com>",
|
|
8
|
-
"
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/cjs-fallback.cjs",
|
|
9
10
|
"files": [
|
|
10
11
|
"dist"
|
|
11
12
|
],
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
29
30
|
"eslint-config-prettier": "^8.0.0",
|
|
30
31
|
"eslint-import-resolver-babel-module": "^5.3.0",
|
|
32
|
+
"eslint-import-resolver-exports": "^1.0.0-beta.5",
|
|
31
33
|
"eslint-plugin-github": "^4.1.3",
|
|
32
34
|
"eslint-plugin-import": "~2.27.0",
|
|
33
35
|
"eslint-plugin-json-format": "^2.0.1",
|
|
@@ -48,6 +50,8 @@
|
|
|
48
50
|
"@dword-design/base": "^9.0.1",
|
|
49
51
|
"deepmerge": "^4.2.2",
|
|
50
52
|
"eslint": "^8.35.0",
|
|
53
|
+
"execa": "^7.1.1",
|
|
54
|
+
"fs-extra": "^11.1.1",
|
|
51
55
|
"output-files": "^2.0.0",
|
|
52
56
|
"with-local-tmp-dir": "^4.0.0"
|
|
53
57
|
},
|