@plumeria/eslint-plugin 0.24.2 → 0.24.3
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/index.d.ts +6 -10
- package/dist/index.js +2 -2
- package/dist/rules/no-destructure.d.ts +2 -2
- package/dist/rules/no-destructure.js +2 -6
- package/dist/rules/no-inner-call.d.ts +2 -2
- package/dist/rules/no-inner-call.js +2 -6
- package/dist/rules/no-unused-keys.d.ts +2 -2
- package/dist/rules/no-unused-keys.js +2 -6
- package/dist/rules/sort-properties.d.ts +2 -2
- package/dist/rules/sort-properties.js +7 -8
- package/dist/rules/validate-values.d.ts +2 -2
- package/dist/rules/validate-values.js +2 -6
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { ESLint, Linter, Rule } from 'eslint';
|
|
2
|
-
|
|
3
|
-
rules:
|
|
4
|
-
"no-destructure": Rule.RuleModule;
|
|
5
|
-
"no-inner-call": Rule.RuleModule;
|
|
6
|
-
"no-unused-keys": Rule.RuleModule;
|
|
7
|
-
"sort-properties": Rule.RuleModule;
|
|
8
|
-
"validate-values": Rule.RuleModule;
|
|
9
|
-
};
|
|
1
|
+
import type { ESLint, Linter, Rule } from 'eslint';
|
|
2
|
+
type PlumeriaPlugin = ESLint.Plugin & {
|
|
3
|
+
rules: Record<string, Rule.RuleModule>;
|
|
10
4
|
configs: {
|
|
11
5
|
recommended: Linter.LegacyConfig;
|
|
12
6
|
};
|
|
13
7
|
flatConfigs: {
|
|
14
|
-
recommended: Linter.
|
|
8
|
+
recommended: Linter.Config;
|
|
15
9
|
};
|
|
16
10
|
};
|
|
11
|
+
export declare const plumeria: PlumeriaPlugin;
|
|
12
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.plumeria = void 0;
|
|
4
4
|
const no_destructure_1 = require("./rules/no-destructure");
|
|
5
|
-
const
|
|
5
|
+
const no_inner_call_1 = require("./rules/no-inner-call");
|
|
6
6
|
const no_unused_keys_1 = require("./rules/no-unused-keys");
|
|
7
7
|
const sort_properties_1 = require("./rules/sort-properties");
|
|
8
8
|
const validate_values_1 = require("./rules/validate-values");
|
|
9
9
|
const rules = {
|
|
10
10
|
'no-destructure': no_destructure_1.noDestructure,
|
|
11
|
-
'no-inner-call':
|
|
11
|
+
'no-inner-call': no_inner_call_1.noInnerCall,
|
|
12
12
|
'no-unused-keys': no_unused_keys_1.noUnusedKeys,
|
|
13
13
|
'sort-properties': sort_properties_1.sortProperties,
|
|
14
14
|
'validate-values': validate_values_1.validateValues,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const noDestructure:
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
export declare const noDestructure: Rule.RuleModule;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.noDestructure = void 0;
|
|
4
|
-
|
|
5
|
-
const createRule = utils_1.ESLintUtils.RuleCreator((name) => name);
|
|
6
|
-
exports.noDestructure = createRule({
|
|
7
|
-
name: 'no-destructure',
|
|
4
|
+
exports.noDestructure = {
|
|
8
5
|
meta: {
|
|
9
6
|
type: 'problem',
|
|
10
7
|
docs: {
|
|
@@ -15,7 +12,6 @@ exports.noDestructure = createRule({
|
|
|
15
12
|
},
|
|
16
13
|
schema: [],
|
|
17
14
|
},
|
|
18
|
-
defaultOptions: [],
|
|
19
15
|
create(context) {
|
|
20
16
|
return {
|
|
21
17
|
VariableDeclarator(node) {
|
|
@@ -42,4 +38,4 @@ exports.noDestructure = createRule({
|
|
|
42
38
|
},
|
|
43
39
|
};
|
|
44
40
|
},
|
|
45
|
-
}
|
|
41
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const noInnerCall:
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
export declare const noInnerCall: Rule.RuleModule;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.noInnerCall = void 0;
|
|
4
|
-
|
|
5
|
-
const createRule = utils_1.ESLintUtils.RuleCreator((name) => name);
|
|
6
|
-
exports.noInnerCall = createRule({
|
|
7
|
-
name: 'no-inner-call',
|
|
4
|
+
exports.noInnerCall = {
|
|
8
5
|
meta: {
|
|
9
6
|
type: 'problem',
|
|
10
7
|
docs: {
|
|
@@ -15,7 +12,6 @@ exports.noInnerCall = createRule({
|
|
|
15
12
|
},
|
|
16
13
|
schema: [],
|
|
17
14
|
},
|
|
18
|
-
defaultOptions: [],
|
|
19
15
|
create(context) {
|
|
20
16
|
let functionDepth = 0;
|
|
21
17
|
return {
|
|
@@ -62,4 +58,4 @@ exports.noInnerCall = createRule({
|
|
|
62
58
|
},
|
|
63
59
|
};
|
|
64
60
|
},
|
|
65
|
-
}
|
|
61
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const noUnusedKeys:
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
export declare const noUnusedKeys: Rule.RuleModule;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.noUnusedKeys = void 0;
|
|
4
|
-
const utils_1 = require("@typescript-eslint/utils");
|
|
5
|
-
const createRule = utils_1.ESLintUtils.RuleCreator((name) => name);
|
|
6
4
|
function getFilename(context) {
|
|
7
5
|
return context.getFilename ? context.getFilename() : context.filename;
|
|
8
6
|
}
|
|
9
|
-
exports.noUnusedKeys =
|
|
10
|
-
name: 'no-unused-keys',
|
|
7
|
+
exports.noUnusedKeys = {
|
|
11
8
|
meta: {
|
|
12
9
|
type: 'problem',
|
|
13
10
|
docs: {
|
|
@@ -18,7 +15,6 @@ exports.noUnusedKeys = createRule({
|
|
|
18
15
|
},
|
|
19
16
|
schema: [],
|
|
20
17
|
},
|
|
21
|
-
defaultOptions: [],
|
|
22
18
|
create(context) {
|
|
23
19
|
const filename = getFilename(context);
|
|
24
20
|
if (filename.endsWith('.ts')) {
|
|
@@ -75,4 +71,4 @@ exports.noUnusedKeys = createRule({
|
|
|
75
71
|
},
|
|
76
72
|
};
|
|
77
73
|
},
|
|
78
|
-
}
|
|
74
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const sortProperties:
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
export declare const sortProperties: Rule.RuleModule;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sortProperties = void 0;
|
|
4
|
-
const utils_1 = require("@typescript-eslint/utils");
|
|
5
4
|
const propertyGroups_1 = require("../util/propertyGroups");
|
|
6
|
-
const createRule = utils_1.ESLintUtils.RuleCreator((name) => name);
|
|
7
5
|
function getSourceCode(context) {
|
|
8
6
|
return context.getSourceCode ? context.getSourceCode() : context.sourceCode;
|
|
9
7
|
}
|
|
@@ -44,8 +42,7 @@ function getPropertyIndex(property, isTopLevel) {
|
|
|
44
42
|
}
|
|
45
43
|
return lastGroupIndex * 1000 + maxPropIndex + 1;
|
|
46
44
|
}
|
|
47
|
-
exports.sortProperties =
|
|
48
|
-
name: 'sort-properties',
|
|
45
|
+
exports.sortProperties = {
|
|
49
46
|
meta: {
|
|
50
47
|
type: 'suggestion',
|
|
51
48
|
docs: {
|
|
@@ -57,7 +54,6 @@ exports.sortProperties = createRule({
|
|
|
57
54
|
sortProperties: 'Property "{{property}}" should be at position {{position}}',
|
|
58
55
|
},
|
|
59
56
|
},
|
|
60
|
-
defaultOptions: [],
|
|
61
57
|
create(context) {
|
|
62
58
|
return {
|
|
63
59
|
ObjectExpression(node) {
|
|
@@ -80,7 +76,7 @@ exports.sortProperties = createRule({
|
|
|
80
76
|
node: prop,
|
|
81
77
|
messageId: 'sortProperties',
|
|
82
78
|
data: {
|
|
83
|
-
position: sorted.indexOf(prop) + 1,
|
|
79
|
+
position: String(sorted.indexOf(prop) + 1),
|
|
84
80
|
property: getPropertyName(prop),
|
|
85
81
|
},
|
|
86
82
|
fix(fixer) {
|
|
@@ -89,11 +85,14 @@ exports.sortProperties = createRule({
|
|
|
89
85
|
return `${indent}${sourceCode.getText(p)}`;
|
|
90
86
|
})
|
|
91
87
|
.join(`,${lineEnding}`);
|
|
92
|
-
return fixer.replaceTextRange([
|
|
88
|
+
return fixer.replaceTextRange([
|
|
89
|
+
node.range[0] + 1,
|
|
90
|
+
node.range[1] - 1,
|
|
91
|
+
], `${lineEnding}${newText}${lineEnding}`);
|
|
93
92
|
},
|
|
94
93
|
});
|
|
95
94
|
});
|
|
96
95
|
},
|
|
97
96
|
};
|
|
98
97
|
},
|
|
99
|
-
}
|
|
98
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const validateValues:
|
|
1
|
+
import { Rule } from 'eslint';
|
|
2
|
+
export declare const validateValues: Rule.RuleModule;
|
|
@@ -357,10 +357,7 @@ const cursorValue = [
|
|
|
357
357
|
'zoom-out',
|
|
358
358
|
varString,
|
|
359
359
|
].join('|');
|
|
360
|
-
|
|
361
|
-
const createRule = utils_1.ESLintUtils.RuleCreator((name) => name);
|
|
362
|
-
exports.validateValues = createRule({
|
|
363
|
-
name: 'validate-values',
|
|
360
|
+
exports.validateValues = {
|
|
364
361
|
meta: {
|
|
365
362
|
type: 'problem',
|
|
366
363
|
docs: {
|
|
@@ -371,7 +368,6 @@ exports.validateValues = createRule({
|
|
|
371
368
|
},
|
|
372
369
|
schema: [],
|
|
373
370
|
},
|
|
374
|
-
defaultOptions: [],
|
|
375
371
|
create(context) {
|
|
376
372
|
return {
|
|
377
373
|
ObjectExpression(node) {
|
|
@@ -2062,4 +2058,4 @@ exports.validateValues = createRule({
|
|
|
2062
2058
|
},
|
|
2063
2059
|
};
|
|
2064
2060
|
},
|
|
2065
|
-
}
|
|
2061
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/eslint-plugin",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.3",
|
|
4
4
|
"description": "Plumeria ESLint plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
"dist/"
|
|
15
15
|
],
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@
|
|
18
|
-
"eslint": "^9.
|
|
17
|
+
"@types/eslint": "^9.6.1",
|
|
18
|
+
"eslint": "^9.39.0",
|
|
19
|
+
"@types/estree": "^1.0.8"
|
|
19
20
|
},
|
|
20
21
|
"publishConfig": {
|
|
21
22
|
"access": "public"
|