@bedrockio/eslint-plugin 1.1.10 → 1.2.0
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/importRules.js +41 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/node-imports.js +3 -22
- package/dist/cjs/typescript-imports.js +4 -14
- package/dist/cjs/vite-imports.js +38 -0
- package/dist/cjs/webpack-imports.js +3 -24
- package/package.json +11 -22
- package/src/importRules.js +54 -0
- package/src/index.js +2 -0
- package/src/node-imports.js +2 -41
- package/src/typescript-imports.js +3 -28
- package/src/vite-imports.js +33 -0
- package/src/webpack-imports.js +2 -44
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = {
|
|
8
|
+
'import/no-unresolved': 'warn',
|
|
9
|
+
'import/no-named-as-default-member': 'off',
|
|
10
|
+
'import/first': 'warn',
|
|
11
|
+
'import/order': ['warn', {
|
|
12
|
+
'newlines-between': 'always-and-inside-groups',
|
|
13
|
+
alphabetize: {
|
|
14
|
+
order: 'asc',
|
|
15
|
+
caseInsensitive: false
|
|
16
|
+
},
|
|
17
|
+
named: true,
|
|
18
|
+
warnOnUnassignedImports: true,
|
|
19
|
+
consolidateIslands: 'inside-groups',
|
|
20
|
+
groups: ['builtin', 'unknown', 'external', 'internal', ['parent', 'sibling'], 'index', 'object', 'type'],
|
|
21
|
+
pathGroups: [{
|
|
22
|
+
pattern: 'semantic',
|
|
23
|
+
group: 'external'
|
|
24
|
+
}, {
|
|
25
|
+
pattern: '+(stores|helpers|layouts|@stores|@helpers|@layouts){,/**}',
|
|
26
|
+
group: 'internal',
|
|
27
|
+
position: 'before'
|
|
28
|
+
}, {
|
|
29
|
+
pattern: '+(screens|modals|components|@screens|@modals|@components){,/**}',
|
|
30
|
+
group: 'internal'
|
|
31
|
+
}, {
|
|
32
|
+
pattern: '+(utils|@utils){,/**}',
|
|
33
|
+
group: 'internal',
|
|
34
|
+
position: 'after'
|
|
35
|
+
}, {
|
|
36
|
+
pattern: '+(assets|@assets){,**}',
|
|
37
|
+
group: 'sibling',
|
|
38
|
+
position: 'after'
|
|
39
|
+
}]
|
|
40
|
+
}]
|
|
41
|
+
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "typescriptImports", {
|
|
|
39
39
|
return _typescriptImports.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "viteImports", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _viteImports.default;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
42
48
|
Object.defineProperty(exports, "webpackImports", {
|
|
43
49
|
enumerable: true,
|
|
44
50
|
get: function () {
|
|
@@ -50,6 +56,7 @@ var _react = _interopRequireDefault(require("./react.js"));
|
|
|
50
56
|
var _jest = _interopRequireDefault(require("./jest.js"));
|
|
51
57
|
var _mdx = _interopRequireDefault(require("./mdx.js"));
|
|
52
58
|
var _nodeImports = _interopRequireDefault(require("./node-imports.js"));
|
|
59
|
+
var _viteImports = _interopRequireDefault(require("./vite-imports.js"));
|
|
53
60
|
var _webpackImports = _interopRequireDefault(require("./webpack-imports.js"));
|
|
54
61
|
var _typescriptImports = _interopRequireDefault(require("./typescript-imports.js"));
|
|
55
62
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/dist/cjs/node-imports.js
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var plugin = _interopRequireWildcard(require("eslint-plugin-import"));
|
|
8
|
+
var _importRules = _interopRequireDefault(require("./importRules.js"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
12
|
var _default = exports.default = {
|
|
@@ -16,28 +18,7 @@ var _default = exports.default = {
|
|
|
16
18
|
sourceType: 'module'
|
|
17
19
|
},
|
|
18
20
|
rules: {
|
|
19
|
-
|
|
20
|
-
'import/no-named-as-default-member': 'off',
|
|
21
|
-
'import/order': ['warn', {
|
|
22
|
-
'newlines-between': 'always-and-inside-groups',
|
|
23
|
-
pathGroups: [{
|
|
24
|
-
pattern: '+(stores|helpers|layouts|@stores|@helpers|@layouts){,/**}',
|
|
25
|
-
group: 'internal',
|
|
26
|
-
position: 'before'
|
|
27
|
-
}, {
|
|
28
|
-
pattern: '+(screens|modals|components|@screens|@modals|@components){,/**}',
|
|
29
|
-
group: 'internal'
|
|
30
|
-
}, {
|
|
31
|
-
pattern: '+(utils|@utils){,/**}',
|
|
32
|
-
group: 'internal',
|
|
33
|
-
position: 'after'
|
|
34
|
-
}, {
|
|
35
|
-
pattern: '+(assets|@assets){,**}',
|
|
36
|
-
group: 'sibling',
|
|
37
|
-
position: 'after'
|
|
38
|
-
}],
|
|
39
|
-
groups: ['builtin', 'unknown', 'external', 'internal', ['parent', 'sibling'], 'index', 'object', 'type']
|
|
40
|
-
}]
|
|
21
|
+
..._importRules.default
|
|
41
22
|
},
|
|
42
23
|
settings: {
|
|
43
24
|
'import/resolver': {
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var plugin = _interopRequireWildcard(require("eslint-plugin-import"));
|
|
8
|
+
var _importRules = _interopRequireDefault(require("./importRules.js"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
12
|
const {
|
|
@@ -13,24 +15,12 @@ const {
|
|
|
13
15
|
} = plugin.configs.recommended;
|
|
14
16
|
var _default = exports.default = {
|
|
15
17
|
...rest,
|
|
16
|
-
files: ['**/*.{ts,tsx}'],
|
|
18
|
+
files: ['**/*.{ts,tsx,js,jsx}'],
|
|
17
19
|
plugins: {
|
|
18
20
|
import: plugin
|
|
19
21
|
},
|
|
20
22
|
rules: {
|
|
21
23
|
'prefer-const': 'off',
|
|
22
|
-
|
|
23
|
-
'import/no-named-as-default-member': 'off',
|
|
24
|
-
'import/order': ['warn', {
|
|
25
|
-
'newlines-between': 'always-and-inside-groups',
|
|
26
|
-
pathGroups: [{
|
|
27
|
-
pattern: 'utils',
|
|
28
|
-
group: 'internal'
|
|
29
|
-
}, {
|
|
30
|
-
pattern: 'utils/**',
|
|
31
|
-
group: 'internal'
|
|
32
|
-
}],
|
|
33
|
-
groups: ['builtin', 'external', 'internal', ['parent', 'sibling'], 'index', 'object', 'type']
|
|
34
|
-
}]
|
|
24
|
+
..._importRules.default
|
|
35
25
|
}
|
|
36
26
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _path = _interopRequireDefault(require("path"));
|
|
8
|
+
var plugin = _interopRequireWildcard(require("eslint-plugin-import"));
|
|
9
|
+
var _importRules = _interopRequireDefault(require("./importRules.js"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
// const bar = path.join(process.cwd(), './vite.config.js');
|
|
14
|
+
// console.info('huh', bar);
|
|
15
|
+
const foo = await Promise.resolve().then(() => _interopRequireWildcard(require('/Users/andrew/Bedrock/core/services/web/vite.config.js')));
|
|
16
|
+
var _default = exports.default = {
|
|
17
|
+
...plugin.flatConfigs.recommended,
|
|
18
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
19
|
+
ignores: ['node_modules/**/*', 'dist/**/*', '**/*.d.ts'],
|
|
20
|
+
languageOptions: {
|
|
21
|
+
ecmaVersion: 'latest',
|
|
22
|
+
sourceType: 'module'
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
...plugin.flatConfigs.recommended.rules,
|
|
26
|
+
..._importRules.default
|
|
27
|
+
},
|
|
28
|
+
settings: {
|
|
29
|
+
'import/resolver': {
|
|
30
|
+
vite: {
|
|
31
|
+
viteConfig: foo.default
|
|
32
|
+
},
|
|
33
|
+
node: {
|
|
34
|
+
moduleDirectory: ['node_modules', 'src']
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var plugin = _interopRequireWildcard(require("eslint-plugin-import"));
|
|
8
|
+
var _importRules = _interopRequireDefault(require("./importRules.js"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
12
|
var _default = exports.default = {
|
|
@@ -17,35 +19,12 @@ var _default = exports.default = {
|
|
|
17
19
|
},
|
|
18
20
|
rules: {
|
|
19
21
|
...plugin.flatConfigs.recommended.rules,
|
|
22
|
+
..._importRules.default,
|
|
20
23
|
'import/no-unresolved': ['warn', {
|
|
21
24
|
// package.json "style" may be used here which
|
|
22
25
|
// will resolve for webpack but not within the
|
|
23
26
|
// eslint plugin
|
|
24
27
|
ignore: ['\\.css$']
|
|
25
|
-
}],
|
|
26
|
-
'import/no-named-as-default-member': 'off',
|
|
27
|
-
'import/order': ['warn', {
|
|
28
|
-
'newlines-between': 'always-and-inside-groups',
|
|
29
|
-
pathGroups: [{
|
|
30
|
-
pattern: 'semantic',
|
|
31
|
-
group: 'external'
|
|
32
|
-
}, {
|
|
33
|
-
pattern: '+(stores|helpers|layouts|@stores|@helpers|@layouts){,/**}',
|
|
34
|
-
group: 'internal',
|
|
35
|
-
position: 'before'
|
|
36
|
-
}, {
|
|
37
|
-
pattern: '+(screens|modals|components|@screens|@modals|@components){,/**}',
|
|
38
|
-
group: 'internal'
|
|
39
|
-
}, {
|
|
40
|
-
pattern: '+(utils|@utils){,/**}',
|
|
41
|
-
group: 'internal',
|
|
42
|
-
position: 'after'
|
|
43
|
-
}, {
|
|
44
|
-
pattern: '+(assets|@assets){,**}',
|
|
45
|
-
group: 'sibling',
|
|
46
|
-
position: 'after'
|
|
47
|
-
}],
|
|
48
|
-
groups: ['builtin', 'unknown', 'external', 'internal', ['parent', 'sibling'], 'index', 'object', 'type']
|
|
49
28
|
}]
|
|
50
29
|
},
|
|
51
30
|
settings: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrockio/eslint-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Common ESLint plugin for Bedrock projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,37 +20,26 @@
|
|
|
20
20
|
"require": "./dist/cjs/index.js"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@eslint/js": "^9.
|
|
23
|
+
"@eslint/js": "^9.33.0",
|
|
24
24
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
25
25
|
"eslint-import-resolver-exports": "^1.0.0-beta.5",
|
|
26
|
-
"eslint-
|
|
27
|
-
"eslint-
|
|
28
|
-
"eslint-plugin-
|
|
29
|
-
"eslint-plugin-
|
|
30
|
-
"
|
|
26
|
+
"eslint-import-resolver-vite": "^2.1.0",
|
|
27
|
+
"eslint-import-resolver-webpack": "^0.13.10",
|
|
28
|
+
"eslint-plugin-import": "^2.32.0",
|
|
29
|
+
"eslint-plugin-jest": "^29.0.1",
|
|
30
|
+
"eslint-plugin-mdx": "^3.6.2",
|
|
31
|
+
"eslint-plugin-react": "^7.37.5",
|
|
32
|
+
"globals": "^16.3.0"
|
|
31
33
|
},
|
|
32
34
|
"peerDependencies": {
|
|
33
|
-
"eslint": ">=9"
|
|
34
|
-
"eslint-import-resolver-webpack": "^0.13.10"
|
|
35
|
-
},
|
|
36
|
-
"peerDependenciesMeta": {
|
|
37
|
-
"eslint-import-resolver-webpack": {
|
|
38
|
-
"optional": true
|
|
39
|
-
},
|
|
40
|
-
"eslint-plugin-react": {
|
|
41
|
-
"optional": true
|
|
42
|
-
},
|
|
43
|
-
"eslint-plugin-mdx": {
|
|
44
|
-
"optional": true
|
|
45
|
-
}
|
|
35
|
+
"eslint": ">=9"
|
|
46
36
|
},
|
|
47
37
|
"devDependencies": {
|
|
48
38
|
"@babel/cli": "^7.26.4",
|
|
49
39
|
"@babel/core": "^7.26.7",
|
|
50
40
|
"@babel/preset-env": "^7.26.7",
|
|
51
41
|
"@bedrockio/prettier-config": "^1.1.1",
|
|
52
|
-
"eslint": "^9.
|
|
53
|
-
"eslint-import-resolver-webpack": "^0.13.10"
|
|
42
|
+
"eslint": "^9.33.0"
|
|
54
43
|
},
|
|
55
44
|
"prettier": "@bedrockio/prettier-config",
|
|
56
45
|
"volta": {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'import/no-unresolved': 'warn',
|
|
3
|
+
'import/no-named-as-default-member': 'off',
|
|
4
|
+
'import/first': 'warn',
|
|
5
|
+
'import/order': [
|
|
6
|
+
'warn',
|
|
7
|
+
{
|
|
8
|
+
'newlines-between': 'always-and-inside-groups',
|
|
9
|
+
alphabetize: {
|
|
10
|
+
order: 'asc',
|
|
11
|
+
caseInsensitive: false,
|
|
12
|
+
},
|
|
13
|
+
named: true,
|
|
14
|
+
warnOnUnassignedImports: true,
|
|
15
|
+
consolidateIslands: 'inside-groups',
|
|
16
|
+
groups: [
|
|
17
|
+
'builtin',
|
|
18
|
+
'unknown',
|
|
19
|
+
'external',
|
|
20
|
+
'internal',
|
|
21
|
+
['parent', 'sibling'],
|
|
22
|
+
'index',
|
|
23
|
+
'object',
|
|
24
|
+
'type',
|
|
25
|
+
],
|
|
26
|
+
pathGroups: [
|
|
27
|
+
{
|
|
28
|
+
pattern: 'semantic',
|
|
29
|
+
group: 'external',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
pattern: '+(stores|helpers|layouts|@stores|@helpers|@layouts){,/**}',
|
|
33
|
+
group: 'internal',
|
|
34
|
+
position: 'before',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
pattern:
|
|
38
|
+
'+(screens|modals|components|@screens|@modals|@components){,/**}',
|
|
39
|
+
group: 'internal',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
pattern: '+(utils|@utils){,/**}',
|
|
43
|
+
group: 'internal',
|
|
44
|
+
position: 'after',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
pattern: '+(assets|@assets){,**}',
|
|
48
|
+
group: 'sibling',
|
|
49
|
+
position: 'after',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
package/src/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { default as react } from './react.js';
|
|
|
3
3
|
import { default as jest } from './jest.js';
|
|
4
4
|
import { default as mdx } from './mdx.js';
|
|
5
5
|
import { default as nodeImports } from './node-imports.js';
|
|
6
|
+
import { default as viteImports } from './vite-imports.js';
|
|
6
7
|
import { default as webpackImports } from './webpack-imports.js';
|
|
7
8
|
import { default as typescriptImports } from './typescript-imports.js';
|
|
8
9
|
|
|
@@ -12,6 +13,7 @@ export {
|
|
|
12
13
|
react,
|
|
13
14
|
recommended,
|
|
14
15
|
nodeImports,
|
|
16
|
+
viteImports,
|
|
15
17
|
webpackImports,
|
|
16
18
|
typescriptImports,
|
|
17
19
|
};
|
package/src/node-imports.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as plugin from 'eslint-plugin-import';
|
|
2
|
+
import importRules from './importRules.js';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
...plugin.flatConfigs.recommended,
|
|
@@ -9,47 +10,7 @@ export default {
|
|
|
9
10
|
sourceType: 'module',
|
|
10
11
|
},
|
|
11
12
|
rules: {
|
|
12
|
-
|
|
13
|
-
'import/no-named-as-default-member': 'off',
|
|
14
|
-
'import/order': [
|
|
15
|
-
'warn',
|
|
16
|
-
{
|
|
17
|
-
'newlines-between': 'always-and-inside-groups',
|
|
18
|
-
pathGroups: [
|
|
19
|
-
{
|
|
20
|
-
pattern:
|
|
21
|
-
'+(stores|helpers|layouts|@stores|@helpers|@layouts){,/**}',
|
|
22
|
-
group: 'internal',
|
|
23
|
-
position: 'before',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
pattern:
|
|
27
|
-
'+(screens|modals|components|@screens|@modals|@components){,/**}',
|
|
28
|
-
group: 'internal',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
pattern: '+(utils|@utils){,/**}',
|
|
32
|
-
group: 'internal',
|
|
33
|
-
position: 'after',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
pattern: '+(assets|@assets){,**}',
|
|
37
|
-
group: 'sibling',
|
|
38
|
-
position: 'after',
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
groups: [
|
|
42
|
-
'builtin',
|
|
43
|
-
'unknown',
|
|
44
|
-
'external',
|
|
45
|
-
'internal',
|
|
46
|
-
['parent', 'sibling'],
|
|
47
|
-
'index',
|
|
48
|
-
'object',
|
|
49
|
-
'type',
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
],
|
|
13
|
+
...importRules,
|
|
53
14
|
},
|
|
54
15
|
settings: {
|
|
55
16
|
'import/resolver': {
|
|
@@ -1,41 +1,16 @@
|
|
|
1
1
|
import * as plugin from 'eslint-plugin-import';
|
|
2
|
+
import importRules from './importRules.js';
|
|
2
3
|
|
|
3
4
|
const { parserOptions, ...rest } = plugin.configs.recommended;
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
...rest,
|
|
7
|
-
files: ['**/*.{ts,tsx}'],
|
|
8
|
+
files: ['**/*.{ts,tsx,js,jsx}'],
|
|
8
9
|
plugins: {
|
|
9
10
|
import: plugin,
|
|
10
11
|
},
|
|
11
12
|
rules: {
|
|
12
13
|
'prefer-const': 'off',
|
|
13
|
-
|
|
14
|
-
'import/no-named-as-default-member': 'off',
|
|
15
|
-
'import/order': [
|
|
16
|
-
'warn',
|
|
17
|
-
{
|
|
18
|
-
'newlines-between': 'always-and-inside-groups',
|
|
19
|
-
pathGroups: [
|
|
20
|
-
{
|
|
21
|
-
pattern: 'utils',
|
|
22
|
-
group: 'internal',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
pattern: 'utils/**',
|
|
26
|
-
group: 'internal',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
groups: [
|
|
30
|
-
'builtin',
|
|
31
|
-
'external',
|
|
32
|
-
'internal',
|
|
33
|
-
['parent', 'sibling'],
|
|
34
|
-
'index',
|
|
35
|
-
'object',
|
|
36
|
-
'type',
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
],
|
|
14
|
+
...importRules,
|
|
40
15
|
},
|
|
41
16
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import * as plugin from 'eslint-plugin-import';
|
|
3
|
+
import importRules from './importRules.js';
|
|
4
|
+
|
|
5
|
+
// const bar = path.join(process.cwd(), './vite.config.js');
|
|
6
|
+
// console.info('huh', bar);
|
|
7
|
+
const foo = await import(
|
|
8
|
+
'/Users/andrew/Bedrock/core/services/web/vite.config.js'
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
...plugin.flatConfigs.recommended,
|
|
13
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
14
|
+
ignores: ['node_modules/**/*', 'dist/**/*', '**/*.d.ts'],
|
|
15
|
+
languageOptions: {
|
|
16
|
+
ecmaVersion: 'latest',
|
|
17
|
+
sourceType: 'module',
|
|
18
|
+
},
|
|
19
|
+
rules: {
|
|
20
|
+
...plugin.flatConfigs.recommended.rules,
|
|
21
|
+
...importRules,
|
|
22
|
+
},
|
|
23
|
+
settings: {
|
|
24
|
+
'import/resolver': {
|
|
25
|
+
vite: {
|
|
26
|
+
viteConfig: foo.default,
|
|
27
|
+
},
|
|
28
|
+
node: {
|
|
29
|
+
moduleDirectory: ['node_modules', 'src'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
package/src/webpack-imports.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as plugin from 'eslint-plugin-import';
|
|
2
|
+
import importRules from './importRules.js';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
...plugin.flatConfigs.recommended,
|
|
@@ -10,6 +11,7 @@ export default {
|
|
|
10
11
|
},
|
|
11
12
|
rules: {
|
|
12
13
|
...plugin.flatConfigs.recommended.rules,
|
|
14
|
+
...importRules,
|
|
13
15
|
'import/no-unresolved': [
|
|
14
16
|
'warn',
|
|
15
17
|
{
|
|
@@ -19,50 +21,6 @@ export default {
|
|
|
19
21
|
ignore: ['\\.css$'],
|
|
20
22
|
},
|
|
21
23
|
],
|
|
22
|
-
'import/no-named-as-default-member': 'off',
|
|
23
|
-
'import/order': [
|
|
24
|
-
'warn',
|
|
25
|
-
{
|
|
26
|
-
'newlines-between': 'always-and-inside-groups',
|
|
27
|
-
pathGroups: [
|
|
28
|
-
{
|
|
29
|
-
pattern: 'semantic',
|
|
30
|
-
group: 'external',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
pattern:
|
|
34
|
-
'+(stores|helpers|layouts|@stores|@helpers|@layouts){,/**}',
|
|
35
|
-
group: 'internal',
|
|
36
|
-
position: 'before',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
pattern:
|
|
40
|
-
'+(screens|modals|components|@screens|@modals|@components){,/**}',
|
|
41
|
-
group: 'internal',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
pattern: '+(utils|@utils){,/**}',
|
|
45
|
-
group: 'internal',
|
|
46
|
-
position: 'after',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
pattern: '+(assets|@assets){,**}',
|
|
50
|
-
group: 'sibling',
|
|
51
|
-
position: 'after',
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
groups: [
|
|
55
|
-
'builtin',
|
|
56
|
-
'unknown',
|
|
57
|
-
'external',
|
|
58
|
-
'internal',
|
|
59
|
-
['parent', 'sibling'],
|
|
60
|
-
'index',
|
|
61
|
-
'object',
|
|
62
|
-
'type',
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
24
|
},
|
|
67
25
|
settings: {
|
|
68
26
|
'import/resolver': {
|