@pobammer-ts/eslint-cease-nonsense-rules 1.12.0 → 1.13.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/build-metadata.json +3 -3
- package/dist/index.js +25 -25
- package/dist/index.js.map +14 -14
- package/dist/rules/ban-instances.d.ts.map +1 -1
- package/dist/rules/no-commented-code.d.ts.map +1 -1
- package/dist/rules/no-shorthand-names.d.ts.map +1 -1
- package/dist/rules/prefer-class-properties.d.ts.map +1 -1
- package/dist/rules/prefer-early-return.d.ts.map +1 -1
- package/dist/rules/prefer-pascal-case-enums.d.ts.map +1 -1
- package/dist/rules/prefer-singular-enums.d.ts.map +1 -1
- package/dist/rules/react-hooks-strict-return.d.ts.map +1 -1
- package/dist/rules/require-named-effect-functions.d.ts.map +1 -1
- package/dist/rules/require-react-component-keys.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/build-metadata.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -16350,7 +16350,7 @@ var ban_instances_default = createRule({
|
|
|
16350
16350
|
description: "Ban specified Roblox Instance classes in new Instance() calls and JSX elements."
|
|
16351
16351
|
},
|
|
16352
16352
|
messages: {
|
|
16353
|
-
bannedInstance: "Instance class '{{className}}' is banned.",
|
|
16353
|
+
bannedInstance: "Instance class '{{className}}' is banned by project configuration. This class may cause performance issues, is deprecated, or has a better alternative. Check project guidelines for the recommended replacement.",
|
|
16354
16354
|
bannedInstanceCustom: "{{customMessage}}"
|
|
16355
16355
|
},
|
|
16356
16356
|
schema: [
|
|
@@ -18176,7 +18176,7 @@ var noCommentedCode = {
|
|
|
18176
18176
|
},
|
|
18177
18177
|
hasSuggestions: true,
|
|
18178
18178
|
messages: {
|
|
18179
|
-
commentedCode: "
|
|
18179
|
+
commentedCode: "Commented-out code creates confusion about intent and clutters the codebase. Version control preserves history, making dead code comments unnecessary. Delete the commented code entirely. If needed later, retrieve it from git history."
|
|
18180
18180
|
},
|
|
18181
18181
|
schema: [],
|
|
18182
18182
|
type: "suggestion"
|
|
@@ -18833,7 +18833,7 @@ var no_print_default = createRule({
|
|
|
18833
18833
|
description: "Ban print() function calls. Use Log instead."
|
|
18834
18834
|
},
|
|
18835
18835
|
messages: {
|
|
18836
|
-
useLog: "
|
|
18836
|
+
useLog: "print() is a raw output function lacking log levels, timestamps, and filtering. Production systems require structured logging for debugging and monitoring. Replace print(...) with something from the logging package."
|
|
18837
18837
|
},
|
|
18838
18838
|
schema: [],
|
|
18839
18839
|
type: "problem"
|
|
@@ -19129,7 +19129,7 @@ var noShorthandNames = {
|
|
|
19129
19129
|
recommended: true
|
|
19130
19130
|
},
|
|
19131
19131
|
messages: {
|
|
19132
|
-
useReplacement: "
|
|
19132
|
+
useReplacement: "'{{shorthand}}' is a shorthand abbreviation that reduces code readability. Abbreviated names force readers to mentally expand them and can mean different things in different contexts. Rename to '{{replacement}}' for clarity and self-documenting code."
|
|
19133
19133
|
},
|
|
19134
19134
|
schema: [
|
|
19135
19135
|
{
|
|
@@ -19561,7 +19561,7 @@ var no_warn_default = createRule({
|
|
|
19561
19561
|
description: "Ban warn() function calls. Use Log instead."
|
|
19562
19562
|
},
|
|
19563
19563
|
messages: {
|
|
19564
|
-
useLog: "
|
|
19564
|
+
useLog: "warn() is a raw output function lacking log levels, timestamps, and filtering. Production systems require structured logging for debugging and monitoring. Replace warn(...) with something from the logging package."
|
|
19565
19565
|
},
|
|
19566
19566
|
schema: [],
|
|
19567
19567
|
type: "problem"
|
|
@@ -19670,8 +19670,8 @@ var prefer_class_properties_default = createRule({
|
|
|
19670
19670
|
description: "Prefer class properties to assignment of literals in constructors."
|
|
19671
19671
|
},
|
|
19672
19672
|
messages: {
|
|
19673
|
-
unexpectedAssignment: "
|
|
19674
|
-
unexpectedClassProperty: "
|
|
19673
|
+
unexpectedAssignment: "Constructor assigns a literal value to this.property. Literals are static and known at class definition time. Move to a class property declaration: propertyName = value; at class level. This clarifies intent and reduces constructor complexity.",
|
|
19674
|
+
unexpectedClassProperty: "Class property declarations are disabled by rule configuration (mode: 'never'). Move initialization into the constructor: this.propertyName = value; inside constructor()."
|
|
19675
19675
|
},
|
|
19676
19676
|
schema: [{ enum: ["always", "never"], type: "string" }],
|
|
19677
19677
|
type: "suggestion"
|
|
@@ -19722,7 +19722,7 @@ var prefer_early_return_default = createRule({
|
|
|
19722
19722
|
description: "Prefer early returns over full-body conditional wrapping in function declarations."
|
|
19723
19723
|
},
|
|
19724
19724
|
messages: {
|
|
19725
|
-
preferEarlyReturn: "
|
|
19725
|
+
preferEarlyReturn: "Function body is wrapped in a single conditional without an else branch. This increases nesting depth and cognitive load. Invert the condition and return early: if (!condition) return; then place the main logic at the top level."
|
|
19726
19726
|
},
|
|
19727
19727
|
schema: [
|
|
19728
19728
|
{
|
|
@@ -19876,7 +19876,7 @@ var prefer_pascal_case_enums_default = createRule({
|
|
|
19876
19876
|
description: "Enforce Pascal case when naming enums."
|
|
19877
19877
|
},
|
|
19878
19878
|
messages: {
|
|
19879
|
-
notPascalCase: "Enum '{{ identifier }}'
|
|
19879
|
+
notPascalCase: "Enum '{{ identifier }}' uses non-standard casing. TypeScript convention requires PascalCase for enum names and members to distinguish them from variables (camelCase) and constants (UPPER_CASE). Rename to PascalCase: capitalize first letter of each word, no underscores."
|
|
19880
19880
|
},
|
|
19881
19881
|
schema: [],
|
|
19882
19882
|
type: "suggestion"
|
|
@@ -20541,7 +20541,7 @@ var prefer_singular_enums_default = createRule({
|
|
|
20541
20541
|
description: "Prefer singular TypeScript enums."
|
|
20542
20542
|
},
|
|
20543
20543
|
messages: {
|
|
20544
|
-
notSingular: "Enum '{{ name }}'
|
|
20544
|
+
notSingular: "Enum '{{ name }}' uses plural naming. Enums define a type of which only ONE value is selected at a time, so singular naming is semantically correct. Use 'Status' not 'Statuses', 'Color' not 'Colors'. Rename the enum to its singular form."
|
|
20545
20545
|
},
|
|
20546
20546
|
schema: [],
|
|
20547
20547
|
type: "suggestion"
|
|
@@ -20838,7 +20838,7 @@ var react_hooks_strict_return_default = createRule({
|
|
|
20838
20838
|
description: "Restrict the number of returned items from React hooks."
|
|
20839
20839
|
},
|
|
20840
20840
|
messages: {
|
|
20841
|
-
hooksStrictReturn: "
|
|
20841
|
+
hooksStrictReturn: "Hook returns more than 2 tuple elements. Destructuring large tuples causes positional errors and breaks when adding values. Return an object with named properties instead: `return { value, setValue, isLoading };`"
|
|
20842
20842
|
},
|
|
20843
20843
|
schema: [],
|
|
20844
20844
|
type: "suggestion"
|
|
@@ -21126,17 +21126,17 @@ var requireNamedEffectFunctions = {
|
|
|
21126
21126
|
recommended: false
|
|
21127
21127
|
},
|
|
21128
21128
|
messages: {
|
|
21129
|
-
anonymousFunction: "
|
|
21130
|
-
arrowFunction: "
|
|
21131
|
-
asyncAnonymousFunction: "Async anonymous
|
|
21132
|
-
asyncArrowFunction: "Async arrow
|
|
21133
|
-
asyncFunctionDeclaration: "Async function
|
|
21134
|
-
asyncFunctionExpression: "Async function
|
|
21135
|
-
functionExpression: "
|
|
21136
|
-
identifierReferencesArrow: "{{
|
|
21137
|
-
identifierReferencesAsyncArrow: "{{
|
|
21138
|
-
identifierReferencesAsyncFunction: "{{
|
|
21139
|
-
identifierReferencesCallback: "{{
|
|
21129
|
+
anonymousFunction: "Anonymous function passed to {{hook}}. debug.info returns empty string for anonymous functions, making stack traces useless for debugging. Extract to: function effectName() { ... } then pass effectName.",
|
|
21130
|
+
arrowFunction: "Arrow function passed to {{hook}}. Arrow functions have no debug name and create new instances each render. Extract to: function effectName() { ... } then pass effectName.",
|
|
21131
|
+
asyncAnonymousFunction: "Async anonymous function in {{hook}}. Two issues: (1) no debug name makes stack traces useless, (2) async effects require cancellation logic for unmount. Extract to: async function effectName() { ... } with cleanup.",
|
|
21132
|
+
asyncArrowFunction: "Async arrow function in {{hook}}. Two issues: (1) arrow functions have no debug name, (2) async effects require cancellation logic. Extract to: async function effectName() { ... } with cleanup.",
|
|
21133
|
+
asyncFunctionDeclaration: "Async function declaration passed to {{hook}}. Async effects require cancellation logic to handle component unmount. Implement cleanup or set allowAsync: true if cancellation is handled.",
|
|
21134
|
+
asyncFunctionExpression: "Async function expression in {{hook}}. Async effects require cancellation logic for unmount. Extract to a named async function declaration with cleanup, then pass the reference.",
|
|
21135
|
+
functionExpression: "Function expression passed to {{hook}}. Function expressions create new instances each render, breaking referential equality. Extract to: function effectName() { ... } at module or component top-level.",
|
|
21136
|
+
identifierReferencesArrow: "{{hook}} receives identifier pointing to arrow function. Arrow functions have no debug name and lack referential stability. Convert to: function effectName() { ... } then pass effectName.",
|
|
21137
|
+
identifierReferencesAsyncArrow: "{{hook}} receives identifier pointing to async arrow function. Two issues: (1) no debug name, (2) async effects require cancellation logic. Convert to: async function effectName() { ... } with cleanup.",
|
|
21138
|
+
identifierReferencesAsyncFunction: "{{hook}} receives identifier pointing to async function. Async effects require cancellation logic for unmount. Implement cleanup or set allowAsync: true if cancellation is handled.",
|
|
21139
|
+
identifierReferencesCallback: "{{hook}} receives identifier from useCallback/useMemo. These hooks return new references when dependencies change, causing unexpected effect re-runs. Use a stable function declaration: function effectName() { ... }"
|
|
21140
21140
|
},
|
|
21141
21141
|
schema: [
|
|
21142
21142
|
{
|
|
@@ -22318,8 +22318,8 @@ var require_react_component_keys_default = createRule({
|
|
|
22318
22318
|
description: "Require keys on React components when used in lists or iteration."
|
|
22319
22319
|
},
|
|
22320
22320
|
messages: {
|
|
22321
|
-
missingKey: "
|
|
22322
|
-
rootComponentWithKey: "Root
|
|
22321
|
+
missingKey: "JSX element in list/callback lacks key prop. React Luau warns about missing keys in _G.__DEV__ mode. Add a unique `key` prop using a stable identifier (not array index).",
|
|
22322
|
+
rootComponentWithKey: "Root return has unnecessary key prop. The key gets overwritten by the parent anyway. Remove the `key` prop."
|
|
22323
22323
|
},
|
|
22324
22324
|
schema: [
|
|
22325
22325
|
{
|
|
@@ -23946,4 +23946,4 @@ export {
|
|
|
23946
23946
|
createBanInstancesOptions
|
|
23947
23947
|
};
|
|
23948
23948
|
|
|
23949
|
-
//# debugId=
|
|
23949
|
+
//# debugId=2B2944174D0F631464756E2164756E21
|