@bedrockio/eslint-plugin 1.0.0 → 1.1.1
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/index.js +55 -0
- package/dist/cjs/jest.js +24 -0
- package/dist/cjs/mdx.js +26 -0
- package/dist/cjs/node-imports.js +29 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/react.js +42 -0
- package/dist/cjs/recommended.js +30 -0
- package/dist/cjs/typescript-imports.js +36 -0
- package/dist/cjs/webpack-imports.js +77 -0
- package/package.json +19 -10
- package/{index.js → src/index.js} +8 -10
- package/{jest.js → src/jest.js} +9 -5
- package/{mdx.js → src/mdx.js} +5 -3
- package/src/react.js +42 -0
- package/{recommended.js → src/recommended.js} +2 -1
- package/{typescript-imports.js → src/typescript-imports.js} +1 -1
- package/{webpack-imports.js → src/webpack-imports.js} +28 -3
- package/react.js +0 -32
- /package/{node-imports.js → src/node-imports.js} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "jest", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _jest.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "mdx", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _mdx.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "nodeImports", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _nodeImports.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "react", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _react.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "recommended", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _recommended.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "typescriptImports", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _typescriptImports.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "webpackImports", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _webpackImports.default;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var _recommended = _interopRequireDefault(require("./recommended.js"));
|
|
49
|
+
var _react = _interopRequireDefault(require("./react.js"));
|
|
50
|
+
var _jest = _interopRequireDefault(require("./jest.js"));
|
|
51
|
+
var _mdx = _interopRequireDefault(require("./mdx.js"));
|
|
52
|
+
var _nodeImports = _interopRequireDefault(require("./node-imports.js"));
|
|
53
|
+
var _webpackImports = _interopRequireDefault(require("./webpack-imports.js"));
|
|
54
|
+
var _typescriptImports = _interopRequireDefault(require("./typescript-imports.js"));
|
|
55
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/dist/cjs/jest.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _eslintPluginJest = _interopRequireDefault(require("eslint-plugin-jest"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = {
|
|
10
|
+
..._eslintPluginJest.default.configs['flat/recommended'],
|
|
11
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
12
|
+
files: ['**/__tests__/**/*.{js,jsx,ts,tsx}', '**/__mocks__/**/*.{js,jsx,ts,tsx}', '**/*.test.js', '**/*.spec.js'],
|
|
13
|
+
languageOptions: {
|
|
14
|
+
globals: _eslintPluginJest.default.environments.globals.globals
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
'jest/expect-expect': ['error', {
|
|
18
|
+
assertFunctionNames: ['expect*', 'assert*']
|
|
19
|
+
}],
|
|
20
|
+
'jest/no-focused-tests': 'off',
|
|
21
|
+
'jest/no-disabled-tests': 'off',
|
|
22
|
+
'jest/no-conditional-expect': 'off'
|
|
23
|
+
}
|
|
24
|
+
};
|
package/dist/cjs/mdx.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var mdx = _interopRequireWildcard(require("eslint-plugin-mdx"));
|
|
8
|
+
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
|
+
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
|
+
const plugin = {
|
|
11
|
+
...mdx.flat,
|
|
12
|
+
files: ['**/*.mdx'],
|
|
13
|
+
processor: mdx.createRemarkProcessor({
|
|
14
|
+
lintCodeBlocks: true
|
|
15
|
+
}),
|
|
16
|
+
rules: {
|
|
17
|
+
...mdx.flat.rules,
|
|
18
|
+
semi: 'off',
|
|
19
|
+
'no-undef': 'off',
|
|
20
|
+
'no-unused-expressions': 'off'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(plugin, 'codeBlocks', {
|
|
24
|
+
value: mdx.flatCodeBlocks
|
|
25
|
+
});
|
|
26
|
+
var _default = exports.default = plugin;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _eslintPluginImport = _interopRequireDefault(require("eslint-plugin-import"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = {
|
|
10
|
+
files: ['**/*.{js,jsx}'],
|
|
11
|
+
plugins: {
|
|
12
|
+
import: _eslintPluginImport.default
|
|
13
|
+
},
|
|
14
|
+
rules: {
|
|
15
|
+
'import/no-unresolved': 'warn',
|
|
16
|
+
'import/no-named-as-default-member': 'off',
|
|
17
|
+
'import/order': ['warn', {
|
|
18
|
+
'newlines-between': 'always-and-inside-groups',
|
|
19
|
+
pathGroups: [{
|
|
20
|
+
pattern: 'utils',
|
|
21
|
+
group: 'internal'
|
|
22
|
+
}, {
|
|
23
|
+
pattern: 'utils/**',
|
|
24
|
+
group: 'internal'
|
|
25
|
+
}],
|
|
26
|
+
groups: ['builtin', 'external', 'internal', ['parent', 'sibling'], 'index', 'object', 'type']
|
|
27
|
+
}]
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs" }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _eslintPluginReact = _interopRequireDefault(require("eslint-plugin-react"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = {
|
|
10
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
11
|
+
plugins: {
|
|
12
|
+
react: _eslintPluginReact.default
|
|
13
|
+
},
|
|
14
|
+
languageOptions: {
|
|
15
|
+
parserOptions: {
|
|
16
|
+
ecmaFeatures: {
|
|
17
|
+
jsx: true
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
..._eslintPluginReact.default.configs['recommended'].rules,
|
|
23
|
+
..._eslintPluginReact.default.configs['jsx-runtime'].rules,
|
|
24
|
+
'no-console': 'warn',
|
|
25
|
+
'react/prop-types': 'off',
|
|
26
|
+
'react/display-name': 'off',
|
|
27
|
+
'react/no-unescaped-entities': ['error', {
|
|
28
|
+
forbid: [{
|
|
29
|
+
char: '>',
|
|
30
|
+
alternatives: ['>']
|
|
31
|
+
}, {
|
|
32
|
+
char: '<',
|
|
33
|
+
alternatives: ['<']
|
|
34
|
+
}]
|
|
35
|
+
}]
|
|
36
|
+
},
|
|
37
|
+
settings: {
|
|
38
|
+
react: {
|
|
39
|
+
version: 'detect'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _js = _interopRequireDefault(require("@eslint/js"));
|
|
8
|
+
var _globals = _interopRequireDefault(require("globals"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = {
|
|
11
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
12
|
+
ignores: ['node_modules/**/*', 'dist/**/*'],
|
|
13
|
+
languageOptions: {
|
|
14
|
+
ecmaVersion: 'latest',
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
globals: {
|
|
17
|
+
..._globals.default.node,
|
|
18
|
+
..._globals.default.browser
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
..._js.default.configs.recommended.rules,
|
|
23
|
+
semi: 'error',
|
|
24
|
+
'no-console': 'warn',
|
|
25
|
+
curly: ['error', 'multi-line', 'consistent'],
|
|
26
|
+
'no-unused-vars': ['warn', {
|
|
27
|
+
ignoreRestSiblings: true
|
|
28
|
+
}]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var plugin = _interopRequireWildcard(require("eslint-plugin-import"));
|
|
8
|
+
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
|
+
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
|
+
const {
|
|
11
|
+
parserOptions,
|
|
12
|
+
...rest
|
|
13
|
+
} = plugin.configs.recommended;
|
|
14
|
+
var _default = exports.default = {
|
|
15
|
+
...rest,
|
|
16
|
+
files: ['**/*.{ts,tsx}'],
|
|
17
|
+
plugins: {
|
|
18
|
+
import: plugin
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
'prefer-const': 'off',
|
|
22
|
+
'import/no-unresolved': 'warn',
|
|
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
|
+
}]
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var plugin = _interopRequireWildcard(require("eslint-plugin-import"));
|
|
8
|
+
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
|
+
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
|
+
const {
|
|
11
|
+
parserOptions,
|
|
12
|
+
...rest
|
|
13
|
+
} = plugin.configs.recommended;
|
|
14
|
+
var _default = exports.default = {
|
|
15
|
+
...rest,
|
|
16
|
+
files: ['**/*.{js,jsx}'],
|
|
17
|
+
plugins: {
|
|
18
|
+
import: plugin
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
'import/no-unresolved': ['warn', {
|
|
22
|
+
// package.json "style" may be used here which
|
|
23
|
+
// will resolve for webpack but not within the
|
|
24
|
+
// eslint plugin
|
|
25
|
+
ignore: ['\\.css$']
|
|
26
|
+
}],
|
|
27
|
+
'import/no-named-as-default-member': 'off',
|
|
28
|
+
'import/order': ['warn', {
|
|
29
|
+
'newlines-between': 'always-and-inside-groups',
|
|
30
|
+
pathGroups: [{
|
|
31
|
+
pattern: 'semantic',
|
|
32
|
+
group: 'external'
|
|
33
|
+
}, {
|
|
34
|
+
pattern: '+(stores|helpers|layouts)',
|
|
35
|
+
group: 'internal',
|
|
36
|
+
position: 'before'
|
|
37
|
+
}, {
|
|
38
|
+
pattern: '+(stores|helpers|layouts)/**',
|
|
39
|
+
group: 'internal',
|
|
40
|
+
position: 'before'
|
|
41
|
+
}, {
|
|
42
|
+
pattern: '+(screens|modals|components)',
|
|
43
|
+
group: 'internal'
|
|
44
|
+
}, {
|
|
45
|
+
pattern: '+(screens|modals|components)/**',
|
|
46
|
+
group: 'internal'
|
|
47
|
+
}, {
|
|
48
|
+
pattern: 'utils',
|
|
49
|
+
group: 'internal',
|
|
50
|
+
position: 'after'
|
|
51
|
+
}, {
|
|
52
|
+
pattern: 'utils/**',
|
|
53
|
+
group: 'internal',
|
|
54
|
+
position: 'after'
|
|
55
|
+
}, {
|
|
56
|
+
pattern: 'assets',
|
|
57
|
+
group: 'sibling',
|
|
58
|
+
position: 'after'
|
|
59
|
+
}, {
|
|
60
|
+
pattern: 'assets/**',
|
|
61
|
+
group: 'sibling',
|
|
62
|
+
position: 'after'
|
|
63
|
+
}],
|
|
64
|
+
groups: ['builtin', 'unknown', 'external', 'internal', ['parent', 'sibling'], 'index', 'object', 'type']
|
|
65
|
+
}]
|
|
66
|
+
},
|
|
67
|
+
settings: {
|
|
68
|
+
'import/resolver': {
|
|
69
|
+
webpack: {
|
|
70
|
+
config: 'webpack.config.js'
|
|
71
|
+
},
|
|
72
|
+
node: {
|
|
73
|
+
extensions: ['.mjs', '.js', '.jsx', '.json']
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
package/package.json
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrockio/eslint-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Common ESLint plugin for Bedrock projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "scripts/build",
|
|
9
|
+
"prepublishOnly": "yarn build"
|
|
10
|
+
},
|
|
7
11
|
"keywords": [
|
|
8
12
|
"eslint",
|
|
9
13
|
"eslintplugin",
|
|
10
14
|
"eslint-plugin"
|
|
11
15
|
],
|
|
12
|
-
"
|
|
16
|
+
"exports": {
|
|
17
|
+
"import": "./src/index.js",
|
|
18
|
+
"require": "./dist/cjs/index.js"
|
|
19
|
+
},
|
|
13
20
|
"dependencies": {
|
|
14
|
-
"@eslint/
|
|
15
|
-
"
|
|
16
|
-
"eslint-plugin-
|
|
17
|
-
"eslint-plugin-jest": "^28.5.0",
|
|
21
|
+
"@eslint/js": "^9.19.0",
|
|
22
|
+
"eslint-plugin-import": "^2.31.0",
|
|
23
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
18
24
|
"eslint-plugin-mdx": "^3.1.5",
|
|
19
|
-
"eslint-plugin-react": "^7.
|
|
20
|
-
"globals": "^15.
|
|
25
|
+
"eslint-plugin-react": "^7.37.4",
|
|
26
|
+
"globals": "^15.14.0"
|
|
21
27
|
},
|
|
22
28
|
"peerDependencies": {
|
|
23
29
|
"eslint": ">=9",
|
|
24
|
-
"eslint-import-resolver-webpack": "^0.13.
|
|
30
|
+
"eslint-import-resolver-webpack": "^0.13.10"
|
|
25
31
|
},
|
|
26
32
|
"peerDependenciesMeta": {
|
|
27
33
|
"eslint-import-resolver-webpack": {
|
|
@@ -35,8 +41,11 @@
|
|
|
35
41
|
}
|
|
36
42
|
},
|
|
37
43
|
"devDependencies": {
|
|
44
|
+
"@babel/cli": "^7.26.4",
|
|
45
|
+
"@babel/core": "^7.26.7",
|
|
46
|
+
"@babel/preset-env": "^7.26.7",
|
|
38
47
|
"eslint": "^9.2.0",
|
|
39
|
-
"eslint-import-resolver-webpack": "^0.13.
|
|
48
|
+
"eslint-import-resolver-webpack": "^0.13.10"
|
|
40
49
|
},
|
|
41
50
|
"volta": {
|
|
42
51
|
"node": "20.12.2",
|
|
@@ -6,14 +6,12 @@ import { default as nodeImports } from './node-imports.js';
|
|
|
6
6
|
import { default as webpackImports } from './webpack-imports.js';
|
|
7
7
|
import { default as typescriptImports } from './typescript-imports.js';
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
typescriptImports,
|
|
18
|
-
},
|
|
9
|
+
export {
|
|
10
|
+
mdx,
|
|
11
|
+
jest,
|
|
12
|
+
react,
|
|
13
|
+
recommended,
|
|
14
|
+
nodeImports,
|
|
15
|
+
webpackImports,
|
|
16
|
+
typescriptImports,
|
|
19
17
|
};
|
package/{jest.js → src/jest.js}
RENAMED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import plugin from 'eslint-plugin-jest';
|
|
2
|
-
import globals from 'globals';
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
4
|
...plugin.configs['flat/recommended'],
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
7
|
+
files: [
|
|
8
|
+
'**/__tests__/**/*.{js,jsx,ts,tsx}',
|
|
9
|
+
'**/__mocks__/**/*.{js,jsx,ts,tsx}',
|
|
10
|
+
'**/*.test.js',
|
|
11
|
+
'**/*.spec.js',
|
|
12
|
+
],
|
|
7
13
|
languageOptions: {
|
|
8
|
-
globals:
|
|
9
|
-
...globals.jest,
|
|
10
|
-
},
|
|
14
|
+
globals: plugin.environments.globals.globals,
|
|
11
15
|
},
|
|
12
16
|
rules: {
|
|
13
17
|
'jest/expect-expect': [
|
package/{mdx.js → src/mdx.js}
RENAMED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import mdx from 'eslint-plugin-mdx';
|
|
1
|
+
import * as mdx from 'eslint-plugin-mdx';
|
|
2
2
|
|
|
3
3
|
const plugin = {
|
|
4
4
|
...mdx.flat,
|
|
5
|
+
files: ['**/*.mdx'],
|
|
5
6
|
processor: mdx.createRemarkProcessor({
|
|
6
7
|
lintCodeBlocks: true,
|
|
7
8
|
}),
|
|
8
9
|
rules: {
|
|
9
10
|
...mdx.flat.rules,
|
|
10
|
-
semi:
|
|
11
|
-
'no-undef':
|
|
11
|
+
semi: 'off',
|
|
12
|
+
'no-undef': 'off',
|
|
13
|
+
'no-unused-expressions': 'off',
|
|
12
14
|
},
|
|
13
15
|
};
|
|
14
16
|
|
package/src/react.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import react from 'eslint-plugin-react';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
5
|
+
plugins: {
|
|
6
|
+
react,
|
|
7
|
+
},
|
|
8
|
+
languageOptions: {
|
|
9
|
+
parserOptions: {
|
|
10
|
+
ecmaFeatures: {
|
|
11
|
+
jsx: true,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
...react.configs['recommended'].rules,
|
|
17
|
+
...react.configs['jsx-runtime'].rules,
|
|
18
|
+
'no-console': 'warn',
|
|
19
|
+
'react/prop-types': 'off',
|
|
20
|
+
'react/display-name': 'off',
|
|
21
|
+
'react/no-unescaped-entities': [
|
|
22
|
+
'error',
|
|
23
|
+
{
|
|
24
|
+
forbid: [
|
|
25
|
+
{
|
|
26
|
+
char: '>',
|
|
27
|
+
alternatives: ['>'],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
char: '<',
|
|
31
|
+
alternatives: ['<'],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
settings: {
|
|
38
|
+
react: {
|
|
39
|
+
version: 'detect',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import plugin from 'eslint-plugin-import';
|
|
1
|
+
import * as plugin from 'eslint-plugin-import';
|
|
2
2
|
|
|
3
3
|
const { parserOptions, ...rest } = plugin.configs.recommended;
|
|
4
4
|
|
|
@@ -9,7 +9,15 @@ export default {
|
|
|
9
9
|
import: plugin,
|
|
10
10
|
},
|
|
11
11
|
rules: {
|
|
12
|
-
'import/no-unresolved':
|
|
12
|
+
'import/no-unresolved': [
|
|
13
|
+
'warn',
|
|
14
|
+
{
|
|
15
|
+
// package.json "style" may be used here which
|
|
16
|
+
// will resolve for webpack but not within the
|
|
17
|
+
// eslint plugin
|
|
18
|
+
ignore: ['\\.css$'],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
13
21
|
'import/no-named-as-default-member': 'off',
|
|
14
22
|
'import/order': [
|
|
15
23
|
'warn',
|
|
@@ -48,6 +56,16 @@ export default {
|
|
|
48
56
|
group: 'internal',
|
|
49
57
|
position: 'after',
|
|
50
58
|
},
|
|
59
|
+
{
|
|
60
|
+
pattern: 'assets',
|
|
61
|
+
group: 'sibling',
|
|
62
|
+
position: 'after',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
pattern: 'assets/**',
|
|
66
|
+
group: 'sibling',
|
|
67
|
+
position: 'after',
|
|
68
|
+
},
|
|
51
69
|
],
|
|
52
70
|
groups: [
|
|
53
71
|
'builtin',
|
|
@@ -63,6 +81,13 @@ export default {
|
|
|
63
81
|
],
|
|
64
82
|
},
|
|
65
83
|
settings: {
|
|
66
|
-
'import/resolver':
|
|
84
|
+
'import/resolver': {
|
|
85
|
+
webpack: {
|
|
86
|
+
config: 'webpack.config.js',
|
|
87
|
+
},
|
|
88
|
+
node: {
|
|
89
|
+
extensions: ['.mjs', '.js', '.jsx', '.json'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
67
92
|
},
|
|
68
93
|
};
|
package/react.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import react from 'eslint-plugin-react';
|
|
2
|
-
import globals from 'globals';
|
|
3
|
-
|
|
4
|
-
// This dependency can be removed when this lands:
|
|
5
|
-
// https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
|
|
6
|
-
import { fixupPluginRules } from '@eslint/compat';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
files: ['**/*.{js,jsx}'],
|
|
10
|
-
plugins: {
|
|
11
|
-
react: fixupPluginRules(react),
|
|
12
|
-
},
|
|
13
|
-
languageOptions: {
|
|
14
|
-
parserOptions: {
|
|
15
|
-
ecmaFeatures: {
|
|
16
|
-
jsx: true,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
globals: {
|
|
20
|
-
...globals.browser,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
rules: {
|
|
24
|
-
...react.configs['recommended'].rules,
|
|
25
|
-
...react.configs['jsx-runtime'].rules,
|
|
26
|
-
},
|
|
27
|
-
settings: {
|
|
28
|
-
react: {
|
|
29
|
-
version: 'detect',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
File without changes
|