Skip to content

Commit 9391cf1

Browse files
committed
refactor(plugins/local): rename 'no-shadowing-underscore' rule to 'no-shadow-underscore'
1 parent 01f2530 commit 9391cf1

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

eslint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export default tseslint.config(
252252
"eslint-plugin/require-meta-docs-url": "off",
253253
// Part: local rules
254254
"local/avoid-multiline-template-expression": "warn",
255-
"local/no-shadowing-underscore": "error",
255+
"local/no-shadow-underscore": "error",
256256
"local/prefer-eqeq-nullish-comparison": "warn",
257257
},
258258
settings: {

packages/utilities/eff/src/lang.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import type { NarrowedTo } from "./type";
66
/**
77
* 1-byte version undefined, produces fewer bytes than `undefined` or `void 0` in the minified output dts.
88
*/
9-
export type _ = undefined; // eslint-disable-line local/no-shadowing-underscore
9+
export type _ = undefined; // eslint-disable-line local/no-shadow-underscore
1010

1111
/**
1212
* 1-byte version undefined, produces fewer bytes than `undefined` or `void 0` in the minified output js.
1313
*/
14-
export const _ = undefined; // eslint-disable-line local/no-shadowing-underscore
14+
export const _ = undefined; // eslint-disable-line local/no-shadow-underscore
1515

1616
/**
1717
* Do nothing and return false

workspace/eslint-plugin-local/dist/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ declare const _default: {
66
readonly version: string;
77
};
88
readonly rules: {
9-
readonly "no-shadowing-underscore": _typescript_eslint_utils_ts_eslint.RuleModule<"noShadowingUnderscore", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
109
readonly "avoid-multiline-template-expression": _typescript_eslint_utils_ts_eslint.RuleModule<"avoidMultilineTemplateExpression", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
10+
readonly "no-shadow-underscore": _typescript_eslint_utils_ts_eslint.RuleModule<"noShadowUnderscore", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
1111
readonly "prefer-eqeq-nullish-comparison": _typescript_eslint_utils_ts_eslint.RuleModule<"unexpectedComparison" | "useLooseComparisonSuggestion", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
1212
};
1313
};

workspace/eslint-plugin-local/dist/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ var avoid_multiline_template_expression_default = createRule({
4343
},
4444
defaultOptions: []
4545
});
46-
var RULE_NAME2 = "no-shadowing-underscore";
46+
var RULE_NAME2 = "no-shadow-underscore";
4747
var RULE_FEATURES2 = [
4848
"CHK"
4949
];
50-
var no_shadowing_underscore_default = createRule({
50+
var no_shadow_underscore_default = createRule({
5151
meta: {
5252
type: "problem",
5353
docs: {
5454
description: "disallow multiline template expressions",
5555
[Symbol.for("rule_features")]: RULE_FEATURES2
5656
},
5757
messages: {
58-
noShadowingUnderscore: "In this codebase, '_' is used to represent the undefined. Avoid shadowing it."
58+
noShadowUnderscore: "In this codebase, '_' is used to represent the undefined. Avoid shadowing it."
5959
},
6060
schema: []
6161
},
@@ -67,7 +67,7 @@ var no_shadowing_underscore_default = createRule({
6767
const isFromImport = VAR.isInitializedFromSource("_", "@eslint-react/eff", initialScope);
6868
if (!isFromImport) {
6969
context.report({
70-
messageId: "noShadowingUnderscore",
70+
messageId: "noShadowUnderscore",
7171
node
7272
});
7373
}
@@ -153,8 +153,8 @@ var index_default = {
153153
version
154154
},
155155
rules: {
156-
"no-shadowing-underscore": no_shadowing_underscore_default,
157156
"avoid-multiline-template-expression": avoid_multiline_template_expression_default,
157+
"no-shadow-underscore": no_shadow_underscore_default,
158158
"prefer-eqeq-nullish-comparison": prefer_eqeq_nullish_comparison_default
159159
}
160160
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { name, version } from "../package.json";
22
import avoidMultilineTemplateExpression from "./rules/avoid-multiline-template-expression";
3-
import noShadowingUnderscore from "./rules/no-shadowing-underscore";
3+
import noShadowingUnderscore from "./rules/no-shadow-underscore";
44
import preferEqeqNullishComparison from "./rules/prefer-eqeq-nullish-comparison";
55

66
export default {
@@ -10,7 +10,7 @@ export default {
1010
},
1111
rules: {
1212
"avoid-multiline-template-expression": avoidMultilineTemplateExpression,
13-
"no-shadowing-underscore": noShadowingUnderscore,
13+
"no-shadow-underscore": noShadowingUnderscore,
1414
"prefer-eqeq-nullish-comparison": preferEqeqNullishComparison,
1515
},
1616
} as const;

workspace/eslint-plugin-local/src/rules/no-shadowing-underscore.spec.ts renamed to workspace/eslint-plugin-local/src/rules/no-shadow-underscore.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import { ruleTester } from "../../../../test";
2-
import rule, { RULE_NAME } from "./no-shadowing-underscore";
2+
import rule, { RULE_NAME } from "./no-shadow-underscore";
33

44
ruleTester.run(RULE_NAME, rule, {
55
invalid: [
66
{
77
code: /* ts */ `
88
const _ = 1;
99
`,
10-
errors: [{ messageId: "noShadowingUnderscore" }],
10+
errors: [{ messageId: "noShadowUnderscore" }],
1111
},
1212
{
1313
code: /* ts */ `
1414
const [_, foo] = [1, 2];
1515
`,
16-
errors: [{ messageId: "noShadowingUnderscore" }],
16+
errors: [{ messageId: "noShadowUnderscore" }],
1717
},
1818
{
1919
code: /* ts */ `
2020
const { name: _, ...rest } = { name: "foo", age: 20 };
2121
`,
22-
errors: [{ messageId: "noShadowingUnderscore" }],
22+
errors: [{ messageId: "noShadowUnderscore" }],
2323
},
2424
],
2525
valid: [

workspace/eslint-plugin-local/src/rules/no-shadowing-underscore.ts renamed to workspace/eslint-plugin-local/src/rules/no-shadow-underscore.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { CamelCase } from "string-ts";
55

66
import { createRule } from "../utils";
77

8-
export const RULE_NAME = "no-shadowing-underscore";
8+
export const RULE_NAME = "no-shadow-underscore";
99

1010
export const RULE_FEATURES = [
1111
"CHK",
@@ -21,7 +21,7 @@ export default createRule<[], MessageID>({
2121
[Symbol.for("rule_features")]: RULE_FEATURES,
2222
},
2323
messages: {
24-
noShadowingUnderscore: "In this codebase, '_' is used to represent the undefined. Avoid shadowing it.",
24+
noShadowUnderscore: "In this codebase, '_' is used to represent the undefined. Avoid shadowing it.",
2525
},
2626
schema: [],
2727
},
@@ -33,7 +33,7 @@ export default createRule<[], MessageID>({
3333
const isFromImport = VAR.isInitializedFromSource("_", "@eslint-react/eff", initialScope);
3434
if (!isFromImport) {
3535
context.report({
36-
messageId: "noShadowingUnderscore",
36+
messageId: "noShadowUnderscore",
3737
node,
3838
});
3939
}

0 commit comments

Comments
 (0)