eslint-plugin-th-rules 3.1.2 → 3.1.4

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/README.md CHANGED
@@ -56,7 +56,7 @@ Recommended plus full strict/stylistic TypeScript configurations.
56
56
  import thRules from "eslint-plugin-th-rules";
57
57
 
58
58
  export default [
59
- ...thRules.configs["recommended-typescript"]
59
+ ...thRules.configs["recommendedTypescript"]
60
60
  ];
61
61
  ```
62
62
 
@@ -72,7 +72,7 @@ Recommended plus:
72
72
  import thRules from "eslint-plugin-th-rules";
73
73
 
74
74
  export default [
75
- ...thRules.configs["recommended-react"]
75
+ ...thRules.configs["recommendedReact"]
76
76
  ];
77
77
  ```
78
78
 
@@ -146,47 +146,27 @@ Do not edit below this line.
146
146
 
147
147
  💼 Configurations enabled in.\
148
148
  ✅ Set in the `recommended` configuration.\
149
- ⚛️ Set in the `recommended-react` configuration.\
150
- 🟦 Set in the `recommended-typescript` configuration.\
149
+ ⚛️ Set in the `recommendedReact` configuration.\
150
+ 🟦 Set in the `recommendedTypescript` configuration.\
151
+ 🎲 Set in the `recommendedTypescriptReact` configuration.\
151
152
  🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
152
153
  💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
153
154
 
154
- | Name                    | Description | 💼 | 🔧 | 💡 |
155
- | :--------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- | :------ | :- | :- |
156
- | [no-boolean-coercion](docs/rules/no-boolean-coercion.md) | Disallow Boolean(value) or !!value. Enforce explicit checks: !_.isNil(value) for scalars and !_.isEmpty(value) for strings, arrays, and objects. | ✅ ⚛️ 🟦 | | 💡 |
157
- | [no-comments](docs/rules/no-comments.md) | Disallow comments except for specified allowed patterns. | ✅ ⚛️ 🟦 | 🔧 | |
158
- | [no-default-export](docs/rules/no-default-export.md) | Convert unnamed default exports to named default exports based on the file name. | ✅ ⚛️ 🟦 | 🔧 | |
159
- | [no-destructuring](docs/rules/no-destructuring.md) | Disallow destructuring that does not meet certain conditions. | ✅ ⚛️ 🟦 | | |
160
- | [prefer-is-empty](docs/rules/prefer-is-empty.md) | Require _.isEmpty instead of length comparisons. | ✅ ⚛️ 🟦 | | 💡 |
161
- | [schemas-in-schemas-file](docs/rules/schemas-in-schemas-file.md) | Require Zod schema declarations to be placed in a .schemas.ts file. | ✅ ⚛️ 🟦 | | |
162
- | [top-level-functions](docs/rules/top-level-functions.md) | Require all top-level functions to be named regular functions. | ✅ ⚛️ 🟦 | 🔧 | |
163
- | [types-in-dts](docs/rules/types-in-dts.md) | Require TypeScript type declarations (type/interface/enum) to be placed in .d.ts files. | ✅ ⚛️ 🟦 | | |
155
+ | Name                 | Description | 💼 | 🔧 | 💡 |
156
+ | :--------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- | :--------- | :- | :- |
157
+ | [noBooleanCoercion](docs/rules/noBooleanCoercion.md) | Disallow Boolean(value) or !!value. Enforce explicit checks: !_.isNil(value) for scalars and !_.isEmpty(value) for strings, arrays, and objects. | ✅ ⚛️ 🟦 🎲 | | 💡 |
158
+ | [noComments](docs/rules/noComments.md) | Disallow comments except for specified allowed patterns. | ✅ ⚛️ 🟦 🎲 | 🔧 | |
159
+ | [noDefaultExport](docs/rules/noDefaultExport.md) | Convert unnamed default exports to named default exports based on the file name. | ✅ ⚛️ 🟦 🎲 | 🔧 | |
160
+ | [noDestructuring](docs/rules/noDestructuring.md) | Disallow destructuring that does not meet certain conditions. | ✅ ⚛️ 🟦 🎲 | | |
161
+ | [preferIsEmpty](docs/rules/preferIsEmpty.md) | Require _.isEmpty instead of length comparisons. | ✅ ⚛️ 🟦 🎲 | | 💡 |
162
+ | [schemasInSchemasFile](docs/rules/schemasInSchemasFile.md) | Require Zod schema declarations to be placed in a .schemas.ts file. | ✅ ⚛️ 🟦 🎲 | | |
163
+ | [topLevelFunctions](docs/rules/topLevelFunctions.md) | Require all top-level functions to be named regular functions. | ✅ ⚛️ 🟦 🎲 | 🔧 | |
164
+ | [typesInDts](docs/rules/typesInDts.md) | Require TypeScript type declarations (type/interface/enum) to be placed in .d.ts files. | ✅ ⚛️ 🟦 🎲 | | |
164
165
 
165
166
  <!-- end auto-generated rules list -->
166
167
 
167
168
  ---
168
169
 
169
- # Updating Documentation
170
-
171
- Auto-generate rule docs:
172
-
173
- ```bash
174
- npm run update:eslint-docs
175
- ```
176
-
177
- Recommended command:
178
-
179
- ```json
180
- "update:eslint-docs": "eslint-doc-generator \
181
- --config-emoji \"recommended,✅\" \
182
- --config-emoji \"recommended-react,⚛️\" \
183
- --config-emoji \"recommended-typescript,🟦\""
184
- ```
185
-
186
- Internal layers (`core-*`, `externals-*`) are not included because they are not presets.
187
-
188
- ---
189
-
190
170
  # License
191
171
 
192
172
  MIT
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../src/configs/core/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAExE,eAAO,MAAM,cAAc,EAAE,iBAAiB,EAiB7C,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../src/configs/core/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAExE,eAAO,MAAM,cAAc,EAAE,iBAAiB,EAmB7C,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -14,6 +14,8 @@ export const coreTypescript = [
14
14
  '@typescript-eslint/no-unsafe-call': 'off',
15
15
  '@typescript-eslint/no-unsafe-return': 'off',
16
16
  '@typescript-eslint/no-unsafe-argument': 'off',
17
+ '@typescript-eslint/no-restricted-types': 'off',
18
+ '@typescript-eslint/naming-convention': 'off',
17
19
  },
18
20
  },
19
21
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"opinionated.d.ts","sourceRoot":"","sources":["../../../src/configs/externals/opinionated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEzD,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EAWnD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"opinionated.d.ts","sourceRoot":"","sources":["../../../src/configs/externals/opinionated.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEzD,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EAanD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
1
2
  export const externalsOpinionated = [
2
3
  {
3
4
  name: 'th-rules/externals-opinionated',
@@ -7,6 +8,8 @@ export const externalsOpinionated = [
7
8
  camelcase: 'warn',
8
9
  'security/detect-unsafe-regex': 'off',
9
10
  'sonarjs/no-clear-text-protocols': 'off',
11
+ 'import-x/extensions': 'off',
12
+ 'unicorn/filename-case': 'off',
10
13
  },
11
14
  },
12
15
  ];
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { type Linter, type Rule } from 'eslint';
2
+ export { rules } from './plugin.js';
2
3
  export declare const configs: {
3
4
  recommended: Linter.Config<import("@eslint/core", { with: { "resolution-mode": "require" } }).RulesConfig>[];
4
5
  recommendedReact: Linter.Config<import("@eslint/core", { with: { "resolution-mode": "require" } }).RulesConfig>[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,MAAM,EAAE,KAAK,IAAI,EAAC,MAAM,QAAQ,CAAC;AAQ9C,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC;AAEF,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAC;AAExE,QAAA,MAAM,KAAK,EAAkC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;CAAC,CAAC;AAChI,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,MAAM,EAAE,KAAK,IAAI,EAAC,MAAM,QAAQ,CAAC;AAQ9C,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAC;AAElC,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC;AAEF,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAC;AAExE,QAAA,MAAM,KAAK,EAAkC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;CAAC,CAAC;AAChI,eAAe,KAAK,CAAC"}
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import { recommendedReact } from './configs/bundles/recommended-react.js';
4
4
  import { recommendedTypescript } from './configs/bundles/recommended-typescript.js';
5
5
  import { recommendedTypescriptReact } from './configs/bundles/recommended-typescript-react.js';
6
6
  import { rules } from './plugin.js';
7
+ export { rules } from './plugin.js';
7
8
  export const configs = {
8
9
  recommended,
9
10
  recommendedReact,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-th-rules",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "A List of custom ESLint rules created by Tomer Horowitz",
5
5
  "keywords": [
6
6
  "eslint",
@@ -19,11 +19,12 @@
19
19
  },
20
20
  "scripts": {
21
21
  "build": "tsc",
22
- "update:eslint-docs": "eslint-doc-generator --config-emoji \"recommended,✅\" --config-emoji \"recommended-react,⚛️\" --config-emoji \"recommended-typescript,🟦\""
22
+ "update:eslint-docs": "eslint-doc-generator --config-emoji \"recommended,✅\" --config-emoji \"recommendedReact,⚛️\" --config-emoji \"recommendedTypescript,🟦\" --config-emoji \"recommendedTypescriptReact,🎲\""
23
23
  },
24
24
  "dependencies": {
25
25
  "@babel/eslint-parser": "^7.28.6",
26
26
  "@eslint/eslintrc": "^3.3.3",
27
+ "@leancodepl/resolve-eslint-flat-config": "^9.7.0",
27
28
  "eslint-config-jsdoc": "^15.4.0",
28
29
  "eslint-config-xo": "^0.49.0",
29
30
  "eslint-config-xo-react": "^0.29.0",
@@ -44,7 +45,6 @@
44
45
  "devDependencies": {
45
46
  "@codedependant/semantic-release-docker": "^5.1.1",
46
47
  "@eslint/js": "^9.39.2",
47
- "@leancodepl/resolve-eslint-flat-config": "^9.7.0",
48
48
  "@semantic-release/changelog": "^6.0.3",
49
49
  "@semantic-release/commit-analyzer": "^13.0.1",
50
50
  "@semantic-release/git": "^10.0.1",