@origin-1/eslint-config 0.16.0 → 0.17.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/lib/create-config.js +25 -2
- package/lib/rules.js +4 -4
- package/package.json +3 -3
package/lib/create-config.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
@@ -245,12 +268,12 @@ function getLanguage(configData) {
|
|
|
245
268
|
return 'js';
|
|
246
269
|
}
|
|
247
270
|
async function importParser(parserName) {
|
|
248
|
-
const parser = await
|
|
271
|
+
const parser = await Promise.resolve(`${parserName}`).then(s => __importStar(require(s)));
|
|
249
272
|
return parser;
|
|
250
273
|
}
|
|
251
274
|
async function importPlugin(pluginName) {
|
|
252
275
|
const pkgName = pluginName.startsWith('@') ? `${pluginName}/eslint-plugin` : `eslint-plugin-${pluginName}`;
|
|
253
|
-
const { default: plugin } = await
|
|
276
|
+
const { default: plugin } = await Promise.resolve(`${pkgName}`).then(s => __importStar(require(s)));
|
|
254
277
|
return plugin;
|
|
255
278
|
}
|
|
256
279
|
function isJSTSEntry(ruleSettings) {
|
package/lib/rules.js
CHANGED
|
@@ -29,7 +29,7 @@ function jsts(jsEntry, tsEntry) {
|
|
|
29
29
|
exports.RULES = {
|
|
30
30
|
[exports.UNIQUE]: {
|
|
31
31
|
'array-callback-return': 'off',
|
|
32
|
-
'constructor-super': ['error'],
|
|
32
|
+
'constructor-super': jsts(['error'], 'off'),
|
|
33
33
|
'for-direction': ['error'],
|
|
34
34
|
'getter-return': ['error'],
|
|
35
35
|
'no-async-promise-executor': ['error'],
|
|
@@ -147,9 +147,9 @@ exports.RULES = {
|
|
|
147
147
|
'no-nested-ternary': 'off',
|
|
148
148
|
'no-new': 'off',
|
|
149
149
|
'no-new-func': 'off',
|
|
150
|
-
'no-new-object': ['error'],
|
|
151
150
|
'no-new-wrappers': ['error'],
|
|
152
151
|
'no-nonoctal-decimal-escape': ['error'],
|
|
152
|
+
'no-object-constructor': ['error'],
|
|
153
153
|
'no-octal': ['error'],
|
|
154
154
|
'no-octal-escape': ['error'],
|
|
155
155
|
'no-param-reassign': 'off',
|
|
@@ -161,7 +161,6 @@ exports.RULES = {
|
|
|
161
161
|
'no-restricted-properties': 'off',
|
|
162
162
|
'no-restricted-syntax': ['error'],
|
|
163
163
|
'no-return-assign': ['error', 'always'],
|
|
164
|
-
'no-return-await': 'off',
|
|
165
164
|
'no-script-url': ['error'],
|
|
166
165
|
'no-sequences': ['error'],
|
|
167
166
|
'no-shadow-restricted-names': ['error'],
|
|
@@ -261,7 +260,7 @@ exports.RULES = {
|
|
|
261
260
|
'yield-star-spacing': ['error', 'both'],
|
|
262
261
|
},
|
|
263
262
|
[exports.HYBRID]: {
|
|
264
|
-
'no-dupe-class-members': ['error'],
|
|
263
|
+
'no-dupe-class-members': jsts(['error'], 'off'),
|
|
265
264
|
'no-loss-of-precision': ['error'],
|
|
266
265
|
'no-unused-vars': beforeJSOrElse(2019, ['error', { ignoreRestSiblings: true, vars: 'local' }], ['error', { caughtErrors: 'all', ignoreRestSiblings: true, vars: 'local' }]),
|
|
267
266
|
'no-use-before-define': 'off',
|
|
@@ -430,6 +429,7 @@ exports.RULES = {
|
|
|
430
429
|
'type-annotation-spacing': ['error'],
|
|
431
430
|
},
|
|
432
431
|
'@origin-1/eslint-plugin': {
|
|
432
|
+
'no-extra-new': ['error'],
|
|
433
433
|
'bracket-layout': ['error'],
|
|
434
434
|
'indent': ['error'],
|
|
435
435
|
'nice-space-before-function-paren': ['error'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@origin-1/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "ESLint configuration generator with Origin₁ presets",
|
|
5
5
|
"homepage": "https://github.com/origin-1/eslint-config#readme",
|
|
6
6
|
"license": "ISC",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"semver": "7"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@origin-1/eslint-plugin": ">=0.
|
|
14
|
+
"@origin-1/eslint-plugin": ">=0.14",
|
|
15
15
|
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
|
16
16
|
"@typescript-eslint/parser": "^6.2.0",
|
|
17
|
-
"eslint": "^8.
|
|
17
|
+
"eslint": "^8.50",
|
|
18
18
|
"eslint-plugin-n": "16"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|