eslint-config-typed 7.0.0 → 7.1.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/constants/index.d.mts +1 -0
- package/dist/constants/index.d.mts.map +1 -1
- package/dist/constants/index.mjs +1 -0
- package/dist/constants/index.mjs.map +1 -1
- package/dist/constants/mutable-prefix.d.mts +9 -0
- package/dist/constants/mutable-prefix.d.mts.map +1 -0
- package/dist/constants/mutable-prefix.mjs +9 -0
- package/dist/constants/mutable-prefix.mjs.map +1 -0
- package/dist/plugins/immer-coding-style/rules/mut-prefixed-draft.d.mts +20 -0
- package/dist/plugins/immer-coding-style/rules/mut-prefixed-draft.d.mts.map +1 -0
- package/dist/plugins/immer-coding-style/rules/mut-prefixed-draft.mjs +187 -0
- package/dist/plugins/immer-coding-style/rules/mut-prefixed-draft.mjs.map +1 -0
- package/dist/plugins/immer-coding-style/rules/rules.d.mts +1 -0
- package/dist/plugins/immer-coding-style/rules/rules.d.mts.map +1 -1
- package/dist/plugins/immer-coding-style/rules/rules.mjs +2 -0
- package/dist/plugins/immer-coding-style/rules/rules.mjs.map +1 -1
- package/dist/rules/eslint-functional-rules.d.mts.map +1 -1
- package/dist/rules/eslint-functional-rules.mjs +3 -2
- package/dist/rules/eslint-functional-rules.mjs.map +1 -1
- package/dist/rules/eslint-immer-coding-style-rules.d.mts +1 -0
- package/dist/rules/eslint-immer-coding-style-rules.d.mts.map +1 -1
- package/dist/rules/eslint-immer-coding-style-rules.mjs +1 -0
- package/dist/rules/eslint-immer-coding-style-rules.mjs.map +1 -1
- package/dist/types/rules/eslint-immer-coding-style-rules.d.mts +15 -0
- package/dist/types/rules/eslint-immer-coding-style-rules.d.mts.map +1 -1
- package/package.json +6 -6
- package/src/constants/index.mts +1 -0
- package/src/constants/mutable-prefix.mts +8 -0
- package/src/plugins/immer-coding-style/rules/mut-prefixed-draft.mts +292 -0
- package/src/plugins/immer-coding-style/rules/mut-prefixed-draft.test.mts +587 -0
- package/src/plugins/immer-coding-style/rules/rules.mts +2 -0
- package/src/rules/eslint-functional-rules.mts +3 -2
- package/src/rules/eslint-immer-coding-style-rules.mts +1 -0
- package/src/types/rules/eslint-immer-coding-style-rules.mts +16 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/constants/index.mts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/constants/index.mts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
package/dist/constants/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/constants/index.mts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/constants/index.mts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The name prefix `functional/immutable-data` and `functional/no-let` let be
|
|
3
|
+
* mutated (`eslint-functional-rules.mts`), and the one
|
|
4
|
+
* `immer-coding-style/mut-prefixed-draft` asks of a draft. The codemod
|
|
5
|
+
* counterpart is ts-codemod-lib's `DEFAULT_MUTABLE_PREFIXES`;
|
|
6
|
+
* `eslint-functional-rules.test.mts` fails when the two differ.
|
|
7
|
+
*/
|
|
8
|
+
export declare const mutablePrefix = "mut_";
|
|
9
|
+
//# sourceMappingURL=mutable-prefix.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutable-prefix.d.mts","sourceRoot":"","sources":["../../src/constants/mutable-prefix.mts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutable-prefix.mjs","sourceRoot":"","sources":["../../src/constants/mutable-prefix.mts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type MessageIds = 'requireMutPrefix';
|
|
3
|
+
/**
|
|
4
|
+
* Reports the draft parameter of an immer recipe whose name lacks the `mut_`
|
|
5
|
+
* prefix. `functional/immutable-data` lets only `mut_`-prefixed bindings be
|
|
6
|
+
* mutated, so an unprefixed draft is otherwise reported on every line that
|
|
7
|
+
* writes to it, with a message that does not say the fix is a rename.
|
|
8
|
+
*
|
|
9
|
+
* The recipe is the second argument of `produce` / `produceWithPatches` when
|
|
10
|
+
* it is a function literal, and otherwise the first when that one is (the
|
|
11
|
+
* curried form). A destructured draft and one that is never referenced are
|
|
12
|
+
* left alone; a draft with a default value is reported.
|
|
13
|
+
*
|
|
14
|
+
* The fix renames the parameter and its references. It is withheld when it
|
|
15
|
+
* could change the code's meaning or add shadowing; `canRename` lists the
|
|
16
|
+
* cases.
|
|
17
|
+
*/
|
|
18
|
+
export declare const mutPrefixedDraftRule: TSESLint.RuleModule<MessageIds>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=mut-prefixed-draft.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mut-prefixed-draft.d.mts","sourceRoot":"","sources":["../../../../src/plugins/immer-coding-style/rules/mut-prefixed-draft.mts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAET,MAAM,0BAA0B,CAAC;AAMlC,KAAK,UAAU,GAAG,kBAAkB,CAAC;AAErC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAgFvD,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { AST_NODE_TYPES, TSESLint, } from '@typescript-eslint/utils';
|
|
2
|
+
import { isTypeWrapper, skipTypeWrappers } from 'eslint-rule-forge';
|
|
3
|
+
import { Arr } from 'ts-data-forge';
|
|
4
|
+
import { mutablePrefix } from '../../../constants/index.mjs';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export const mutPrefixedDraftRule = {
|
|
21
|
+
meta: {
|
|
22
|
+
type: 'suggestion',
|
|
23
|
+
docs: {
|
|
24
|
+
description: `Require the \`${mutablePrefix}\` prefix on the draft parameter of an immer recipe.`,
|
|
25
|
+
},
|
|
26
|
+
fixable: 'code',
|
|
27
|
+
schema: [],
|
|
28
|
+
messages: {
|
|
29
|
+
requireMutPrefix: `Name the draft \`{{suggested}}\` instead of \`{{name}}\`: \`functional/immutable-data\` allows mutation only through \`${mutablePrefix}\`-prefixed bindings.`,
|
|
30
|
+
},
|
|
31
|
+
defaultOptions: [],
|
|
32
|
+
},
|
|
33
|
+
create: (context) => ({
|
|
34
|
+
CallExpression: (node) => {
|
|
35
|
+
const recipe = findRecipe(node);
|
|
36
|
+
if (recipe === undefined) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const param = draftParameterOf(recipe);
|
|
40
|
+
if (param === undefined || param.name.startsWith(mutablePrefix)) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const scope = context.sourceCode.scopeManager?.scopes.find((s) => s.type === TSESLint.Scope.ScopeType.function &&
|
|
44
|
+
s.block.range[0] === recipe.range[0] &&
|
|
45
|
+
s.block.range[1] === recipe.range[1]);
|
|
46
|
+
if (scope === undefined) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const variable = scope.set.get(param.name);
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
const declared = variable?.identifiers[0];
|
|
53
|
+
if (variable === undefined || declared === undefined) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
const nameToken = context.sourceCode.getFirstToken(declared);
|
|
59
|
+
const references = usesOf(variable);
|
|
60
|
+
if (nameToken === null || Arr.isEmpty(references)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const suggested = `${mutablePrefix}${param.name}`;
|
|
64
|
+
context.report({
|
|
65
|
+
loc: nameToken.loc,
|
|
66
|
+
messageId: 'requireMutPrefix',
|
|
67
|
+
data: { name: param.name, suggested },
|
|
68
|
+
fix: canRename(scope, variable, suggested)
|
|
69
|
+
? (fixer) => Arr.toUnshifted(references.map(({ identifier }) => identifier.parent.type === AST_NODE_TYPES.Property &&
|
|
70
|
+
identifier.parent.shorthand &&
|
|
71
|
+
identifier.parent.value === identifier
|
|
72
|
+
? fixer.insertTextAfter(identifier, `: ${suggested}`)
|
|
73
|
+
: fixer.replaceText(identifier, suggested)), fixer.replaceText(nameToken, suggested))
|
|
74
|
+
: null,
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
};
|
|
79
|
+
const produceNames = new Set([
|
|
80
|
+
'produce',
|
|
81
|
+
'produceWithPatches',
|
|
82
|
+
]);
|
|
83
|
+
const isFunctionNode = (node) => node.type === AST_NODE_TYPES.ArrowFunctionExpression ||
|
|
84
|
+
node.type === AST_NODE_TYPES.FunctionExpression;
|
|
85
|
+
const findRecipe = (node) => {
|
|
86
|
+
const callee = skipTypeWrappers(node.callee);
|
|
87
|
+
if (callee.type !== AST_NODE_TYPES.Identifier ||
|
|
88
|
+
!produceNames.has(callee.name)) {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (node.arguments.some((a) => a.type === AST_NODE_TYPES.SpreadElement)) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
const [first, second] = [node.arguments[0], node.arguments[1]].map((argument) => argument === undefined || argument.type === AST_NODE_TYPES.SpreadElement
|
|
96
|
+
? undefined
|
|
97
|
+
: skipTypeWrappers(argument));
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
return second !== undefined && isFunctionNode(second)
|
|
103
|
+
? second
|
|
104
|
+
: first !== undefined &&
|
|
105
|
+
isFunctionNode(first) &&
|
|
106
|
+
Arr.isMaxLengthArray(2, node.arguments)
|
|
107
|
+
? first
|
|
108
|
+
: undefined;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
const draftParameterOf = (recipe) => {
|
|
116
|
+
const first = recipe.params.find((p) => p.type !== AST_NODE_TYPES.Identifier || p.name !== 'this');
|
|
117
|
+
const param = first?.type === AST_NODE_TYPES.AssignmentPattern ? first.left : first;
|
|
118
|
+
return param?.type === AST_NODE_TYPES.Identifier ? param : undefined;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
const usesOf = (variable) => variable.references.filter(({ identifier }) => identifier !== variable.identifiers[0]);
|
|
125
|
+
const outsideTypeWrappers = (node) => node !== undefined && isTypeWrapper(node)
|
|
126
|
+
? outsideTypeWrappers(node.parent)
|
|
127
|
+
: node;
|
|
128
|
+
const isRecipe = (node) => {
|
|
129
|
+
const call = outsideTypeWrappers(node.parent);
|
|
130
|
+
return (call?.type === AST_NODE_TYPES.CallExpression && findRecipe(call) === node);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
const isDraftNameOfRecipeAround = (scope, name) => {
|
|
137
|
+
const { upper } = scope;
|
|
138
|
+
if (upper === null) {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
const { block } = upper;
|
|
142
|
+
const outer = upper.set.get(name);
|
|
143
|
+
return (
|
|
144
|
+
|
|
145
|
+
(isFunctionNode(block) &&
|
|
146
|
+
isRecipe(block) &&
|
|
147
|
+
draftParameterOf(block)?.name === name &&
|
|
148
|
+
outer !== undefined &&
|
|
149
|
+
Arr.isNonEmpty(usesOf(outer))) ||
|
|
150
|
+
isDraftNameOfRecipeAround(upper, name));
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const isValueIn = (scope, name) => scope.set.get(name)?.isValueVariable ?? false;
|
|
154
|
+
|
|
155
|
+
const isDeclaredWithin = (scope, name) => isValueIn(scope, name) ||
|
|
156
|
+
scope.childScopes.some((child) => isDeclaredWithin(child, name));
|
|
157
|
+
|
|
158
|
+
const isDeclaredAround = (scope, name) => scope.upper !== null &&
|
|
159
|
+
(isValueIn(scope.upper, name) || isDeclaredAround(scope.upper, name));
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
const canRename = (scope, variable, newName) => !isDeclaredWithin(scope, newName) &&
|
|
176
|
+
!isDeclaredAround(scope, newName) &&
|
|
177
|
+
scope.through.every(
|
|
178
|
+
|
|
179
|
+
(reference) => !reference.isValueReference ||
|
|
180
|
+
(reference.identifier.name !== newName &&
|
|
181
|
+
reference.identifier.name !== 'eval')) &&
|
|
182
|
+
!isDraftNameOfRecipeAround(scope, variable.name) &&
|
|
183
|
+
Arr.isFixedLengthArray(1, variable.defs) &&
|
|
184
|
+
variable.references.every(
|
|
185
|
+
|
|
186
|
+
(reference) => !reference.isWrite() || reference.init === true);
|
|
187
|
+
//# sourceMappingURL=mut-prefixed-draft.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mut-prefixed-draft.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,SAAS,CAAC,OAAO,EAAE,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,CAC/D,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const immerCodingStyleRules: {
|
|
2
|
+
readonly 'mut-prefixed-draft': import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireMutPrefix", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
2
3
|
readonly 'prefer-curried-produce': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useCurriedProduce", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
3
4
|
};
|
|
4
5
|
//# sourceMappingURL=rules.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.mts","sourceRoot":"","sources":["../../../../src/plugins/immer-coding-style/rules/rules.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rules.d.mts","sourceRoot":"","sources":["../../../../src/plugins/immer-coding-style/rules/rules.mts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;;CAGQ,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { mutPrefixedDraftRule } from './mut-prefixed-draft.mjs';
|
|
1
2
|
import { preferCurriedProduceRule } from './prefer-curried-produce.mjs';
|
|
2
3
|
export const immerCodingStyleRules = {
|
|
4
|
+
'mut-prefixed-draft': mutPrefixedDraftRule,
|
|
3
5
|
'prefer-curried-produce': preferCurriedProduceRule,
|
|
4
6
|
};
|
|
5
7
|
//# sourceMappingURL=rules.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.mjs","sourceRoot":"","sources":["../../../../src/plugins/immer-coding-style/rules/rules.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,wBAAwB,EAAE,wBAAwB;CACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"rules.mjs","sourceRoot":"","sources":["../../../../src/plugins/immer-coding-style/rules/rules.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,oBAAoB,EAAE,oBAAoB;IAC1C,wBAAwB,EAAE,wBAAwB;CACV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-functional-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-functional-rules.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eslint-functional-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-functional-rules.mts"],"names":[],"mappings":"AAkBA,qEAAqE;AACrE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;sCAqCP,KAAK;0CACD,KAAK;+CAQA,KAAK;qDAGC,KAAK;oDAeN,KAAK;8CACX,KAAK;0CACT,KAAK;6CAGF,KAAK;+CACH,KAAK;6CACP,KAAK;iDAGD,KAAK;wCAGd,KAAK;yCAeJ,KAAK;kDAGI,KAAK;yDA6BE,KAAK;;gDA0Bd,CAAC;CACI,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mutablePrefix } from '../constants/index.mjs';
|
|
1
2
|
import { withDefaultOption, } from '../types/index.mjs';
|
|
2
3
|
|
|
3
4
|
|
|
@@ -9,7 +10,7 @@ import { withDefaultOption, } from '../types/index.mjs';
|
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
const ignoredMutablePattern = [
|
|
13
|
+
const ignoredMutablePattern = [`^${mutablePrefix}`];
|
|
13
14
|
|
|
14
15
|
export const eslintFunctionalRules = {
|
|
15
16
|
|
|
@@ -26,7 +27,7 @@ export const eslintFunctionalRules = {
|
|
|
26
27
|
],
|
|
27
28
|
ignoreNonConstDeclarations: false,
|
|
28
29
|
ignoreAccessorPattern: [
|
|
29
|
-
|
|
30
|
+
`**.${mutablePrefix}**`,
|
|
30
31
|
'this.**',
|
|
31
32
|
'super.**',
|
|
32
33
|
'**.current.**',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-functional-rules.mjs","sourceRoot":"","sources":["../../src/rules/eslint-functional-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAE5B,gFAAgF;AAChF,gFAAgF;AAChF,+EAA+E;AAC/E,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,qEAAqE;AACrE,8EAA8E;AAC9E,6EAA6E;AAC7E,SAAS;AACT,MAAM,qBAAqB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"eslint-functional-rules.mjs","sourceRoot":"","sources":["../../src/rules/eslint-functional-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAE5B,gFAAgF;AAChF,gFAAgF;AAChF,+EAA+E;AAC/E,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,qEAAqE;AACrE,8EAA8E;AAC9E,6EAA6E;AAC7E,SAAS;AACT,MAAM,qBAAqB,GAAG,CAAC,IAAI,aAAa,EAAE,CAAU,CAAC;AAE7D,qEAAqE;AACrE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,qBAAqB;IACrB,2BAA2B,EAAE;QAC3B,OAAO;QACP;YACE,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,uBAAuB,EAAE;gBACvB,GAAG,qBAAqB;gBACxB,MAAM;gBACN,OAAO;gBACP,sBAAsB;aACvB;YACD,0BAA0B,EAAE,KAAK;YACjC,qBAAqB,EAAE;gBACrB,MAAM,aAAa,IAAI;gBACvB,SAAS;gBAC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AAK;IAEjC,OAAO;IACP,mCAAmC,EAAE,KAAK;IAC1C,yCAAyC;IACzC,YAAY;IACZ,MAAM;IACN,gCAAgC;IAChC,gDAAgD;IAChD,4BAA4B;IAC5B,kCAAkC;IAClC,eAAe;IACf,2BAA2B;IAC3B,YAAY;IACZ,qBAAqB;IACrB,8EAA8E;IAC9E,oCAAoC;IACpC,aAAa;IACb,YAAY;IACZ,gDAAgD;IAChD,uCAAuC;IACvC,aAAa;IACb,YAAY;IACZ,+BAA+B;IAC/B,qCAAqC;IACrC,aAAa;IACb,WAAW;IACX,6BAA6B;IAC7B,0BAA0B;IAC1B,SAAS;IACT,OAAO;IACP,KAAK;IACL,0CAA0C,EAAE,KAAK;IACjD,gDAAgD;IAChD,aAAa;IACb,MAAM;IACN,qBAAqB;IACrB,eAAe;IACf,UAAU;IACV,8BAA8B;IAC9B,qCAAqC;IACrC,iCAAiC;IACjC,wBAAwB;IACxB,WAAW;IACX,UAAU;IACV,sCAAsC;IACtC,mCAAmC;IACnC,iCAAiC;IACjC,wBAAwB;IACxB,WAAW;IACX,SAAS;IACT,+BAA+B;IAC/B,OAAO;IACP,KAAK;IAEL,iCAAiC,EAAE,iBAAiB,CAAC,OAAO,CAAC;IAE7D,aAAa;IACb,iCAAiC,EAAE,CAAC;CACI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-immer-coding-style-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-immer-coding-style-rules.mts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B;
|
|
1
|
+
{"version":3,"file":"eslint-immer-coding-style-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-immer-coding-style-rules.mts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B;sDACG,OAAO;0DACH,OAAO;CACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-immer-coding-style-rules.mjs","sourceRoot":"","sources":["../../src/rules/eslint-immer-coding-style-rules.mts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,2CAA2C,EAAE,OAAO;CACN,CAAC"}
|
|
1
|
+
{"version":3,"file":"eslint-immer-coding-style-rules.mjs","sourceRoot":"","sources":["../../src/rules/eslint-immer-coding-style-rules.mts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,uCAAuC,EAAE,OAAO;IAChD,2CAA2C,EAAE,OAAO;CACN,CAAC"}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* @description Require the `mut_` prefix on the draft parameter of an immer recipe.
|
|
4
|
+
*
|
|
5
|
+
* ```md
|
|
6
|
+
* | key | value |
|
|
7
|
+
* | :--------- | :--------- |
|
|
8
|
+
* | type | suggestion |
|
|
9
|
+
* | deprecated | false |
|
|
10
|
+
* | fixable | code |
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
declare namespace MutPrefixedDraft {
|
|
14
|
+
type RuleEntry = Linter.StringSeverity;
|
|
15
|
+
}
|
|
2
16
|
/**
|
|
3
17
|
* @description Prefer the curried overload of immer produce for shorter updater definitions.
|
|
4
18
|
*
|
|
@@ -14,6 +28,7 @@ declare namespace PreferCurriedProduce {
|
|
|
14
28
|
type RuleEntry = Linter.StringSeverity;
|
|
15
29
|
}
|
|
16
30
|
export type EslintImmerCodingStyleRules = Readonly<{
|
|
31
|
+
'immer-coding-style/mut-prefixed-draft': MutPrefixedDraft.RuleEntry;
|
|
17
32
|
'immer-coding-style/prefer-curried-produce': PreferCurriedProduce.RuleEntry;
|
|
18
33
|
}>;
|
|
19
34
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-immer-coding-style-rules.d.mts","sourceRoot":"","sources":["../../../src/types/rules/eslint-immer-coding-style-rules.mts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC;;;;;;;;;;GAUG;AACH,kBAAU,oBAAoB,CAAC;IAC7B,KAAY,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;CAC/C;AAED,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,2CAA2C,EAAE,oBAAoB,CAAC,SAAS,CAAC;CAC7E,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"eslint-immer-coding-style-rules.d.mts","sourceRoot":"","sources":["../../../src/types/rules/eslint-immer-coding-style-rules.mts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC;;;;;;;;;;GAUG;AACH,kBAAU,gBAAgB,CAAC;IACzB,KAAY,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;CAC/C;AAED;;;;;;;;;;GAUG;AACH,kBAAU,oBAAoB,CAAC;IAC7B,KAAY,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;CAC/C;AAED,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IACjD,uCAAuC,EAAE,gBAAgB,CAAC,SAAS,CAAC;IACpE,2CAA2C,EAAE,oBAAoB,CAAC,SAAS,CAAC;CAC7E,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-typed",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"eslint-plugin-sort-destructure-keys": "^3.0.0",
|
|
71
71
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
72
72
|
"eslint-plugin-unicorn": "^78.0.0",
|
|
73
|
-
"eslint-rule-forge": "^0.
|
|
73
|
+
"eslint-rule-forge": "^0.4.0",
|
|
74
74
|
"globals": "^17.13.0",
|
|
75
75
|
"is-glob": "^4.0.3",
|
|
76
76
|
"is-immutable-type": "^5.0.4",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"@vitest/ui": "5.0.5",
|
|
91
91
|
"cspell": "10.4.0",
|
|
92
92
|
"dedent": "1.7.2",
|
|
93
|
-
"eslint-config-typed": "7.
|
|
94
|
-
"eslint-plugin-ts-data-forge": "0.10.
|
|
95
|
-
"eslint-plugin-ts-fortress": "1.3.
|
|
96
|
-
"eslint-plugin-ts-type-forge": "0.8.
|
|
93
|
+
"eslint-config-typed": "7.1.0",
|
|
94
|
+
"eslint-plugin-ts-data-forge": "0.10.5",
|
|
95
|
+
"eslint-plugin-ts-fortress": "1.3.10",
|
|
96
|
+
"eslint-plugin-ts-type-forge": "0.8.15",
|
|
97
97
|
"immer": "11.2.7",
|
|
98
98
|
"jiti": "2.7.0",
|
|
99
99
|
"json-schema": "0.4.0",
|
package/src/constants/index.mts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The name prefix `functional/immutable-data` and `functional/no-let` let be
|
|
3
|
+
* mutated (`eslint-functional-rules.mts`), and the one
|
|
4
|
+
* `immer-coding-style/mut-prefixed-draft` asks of a draft. The codemod
|
|
5
|
+
* counterpart is ts-codemod-lib's `DEFAULT_MUTABLE_PREFIXES`;
|
|
6
|
+
* `eslint-functional-rules.test.mts` fails when the two differ.
|
|
7
|
+
*/
|
|
8
|
+
export const mutablePrefix = 'mut_';
|