@bedrockio/eslint-plugin 1.5.2 → 1.5.4
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/react.js +1 -0
- package/dist/cjs/typescript.js +20 -7
- package/dist/esm/react.js +1 -0
- package/dist/esm/typescript.js +19 -6
- package/package.json +1 -1
- package/src/react.js +1 -0
- package/src/typescript.js +22 -6
package/dist/cjs/react.js
CHANGED
package/dist/cjs/typescript.js
CHANGED
|
@@ -4,8 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
7
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
8
|
+
let ts;
|
|
9
|
+
let importError;
|
|
10
|
+
try {
|
|
11
|
+
ts = (await Promise.resolve().then(() => _interopRequireWildcard(require('typescript-eslint')))).default;
|
|
12
|
+
} catch (err) {
|
|
13
|
+
importError = err;
|
|
14
|
+
}
|
|
9
15
|
var _default = exports.default = {
|
|
10
16
|
name: 'typescript',
|
|
11
17
|
files: ['**/*.{ts,tsx}'],
|
|
@@ -13,18 +19,25 @@ var _default = exports.default = {
|
|
|
13
19
|
languageOptions: {
|
|
14
20
|
ecmaVersion: 'latest',
|
|
15
21
|
sourceType: 'module',
|
|
16
|
-
parser:
|
|
22
|
+
parser: ts?.parser
|
|
17
23
|
},
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
// Throw error if import failed only if
|
|
25
|
+
// plugin is actually being used.
|
|
26
|
+
get plugins() {
|
|
27
|
+
if (importError) {
|
|
28
|
+
throw importError;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
'@typescript-eslint': ts.plugin
|
|
32
|
+
};
|
|
20
33
|
},
|
|
21
34
|
rules: {
|
|
22
35
|
// Pull in `eslint-recommended` adjustments from typescript-eslint.
|
|
23
36
|
// This disables core ESLint rules that conflict with TypeScript (e.g. no-undef).
|
|
24
|
-
...
|
|
37
|
+
...ts?.plugin.configs['eslint-recommended'].overrides[0].rules,
|
|
25
38
|
// Pull in the TypeScript recommended rules themselves.
|
|
26
39
|
// Avoid the flat config version as it's an array.
|
|
27
|
-
...
|
|
40
|
+
...ts?.plugin.configs.recommended.rules,
|
|
28
41
|
'@typescript-eslint/no-unused-vars': 'warn',
|
|
29
42
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
30
43
|
// The above configs try to slip this rule in there despite it
|
package/dist/esm/react.js
CHANGED
package/dist/esm/typescript.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
let ts;
|
|
2
|
+
let importError;
|
|
3
|
+
try {
|
|
4
|
+
ts = (await import('typescript-eslint')).default;
|
|
5
|
+
} catch (err) {
|
|
6
|
+
importError = err;
|
|
7
|
+
}
|
|
2
8
|
export default {
|
|
3
9
|
name: 'typescript',
|
|
4
10
|
files: ['**/*.{ts,tsx}'],
|
|
@@ -6,18 +12,25 @@ export default {
|
|
|
6
12
|
languageOptions: {
|
|
7
13
|
ecmaVersion: 'latest',
|
|
8
14
|
sourceType: 'module',
|
|
9
|
-
parser: ts
|
|
15
|
+
parser: ts?.parser
|
|
10
16
|
},
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
// Throw error if import failed only if
|
|
18
|
+
// plugin is actually being used.
|
|
19
|
+
get plugins() {
|
|
20
|
+
if (importError) {
|
|
21
|
+
throw importError;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
'@typescript-eslint': ts.plugin
|
|
25
|
+
};
|
|
13
26
|
},
|
|
14
27
|
rules: {
|
|
15
28
|
// Pull in `eslint-recommended` adjustments from typescript-eslint.
|
|
16
29
|
// This disables core ESLint rules that conflict with TypeScript (e.g. no-undef).
|
|
17
|
-
...ts
|
|
30
|
+
...ts?.plugin.configs['eslint-recommended'].overrides[0].rules,
|
|
18
31
|
// Pull in the TypeScript recommended rules themselves.
|
|
19
32
|
// Avoid the flat config version as it's an array.
|
|
20
|
-
...ts
|
|
33
|
+
...ts?.plugin.configs.recommended.rules,
|
|
21
34
|
'@typescript-eslint/no-unused-vars': 'warn',
|
|
22
35
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
23
36
|
// The above configs try to slip this rule in there despite it
|
package/package.json
CHANGED
package/src/react.js
CHANGED
package/src/typescript.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
let ts;
|
|
2
|
+
let importError;
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
ts = (await import('typescript-eslint')).default;
|
|
6
|
+
} catch (err) {
|
|
7
|
+
importError = err;
|
|
8
|
+
}
|
|
2
9
|
|
|
3
10
|
export default {
|
|
4
11
|
name: 'typescript',
|
|
@@ -7,19 +14,28 @@ export default {
|
|
|
7
14
|
languageOptions: {
|
|
8
15
|
ecmaVersion: 'latest',
|
|
9
16
|
sourceType: 'module',
|
|
10
|
-
parser: ts
|
|
17
|
+
parser: ts?.parser,
|
|
11
18
|
},
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
|
|
20
|
+
// Throw error if import failed only if
|
|
21
|
+
// plugin is actually being used.
|
|
22
|
+
get plugins() {
|
|
23
|
+
if (importError) {
|
|
24
|
+
throw importError;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
'@typescript-eslint': ts.plugin,
|
|
28
|
+
};
|
|
14
29
|
},
|
|
30
|
+
|
|
15
31
|
rules: {
|
|
16
32
|
// Pull in `eslint-recommended` adjustments from typescript-eslint.
|
|
17
33
|
// This disables core ESLint rules that conflict with TypeScript (e.g. no-undef).
|
|
18
|
-
...ts
|
|
34
|
+
...ts?.plugin.configs['eslint-recommended'].overrides[0].rules,
|
|
19
35
|
|
|
20
36
|
// Pull in the TypeScript recommended rules themselves.
|
|
21
37
|
// Avoid the flat config version as it's an array.
|
|
22
|
-
...ts
|
|
38
|
+
...ts?.plugin.configs.recommended.rules,
|
|
23
39
|
'@typescript-eslint/no-unused-vars': 'warn',
|
|
24
40
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
25
41
|
|