|
1 | 1 | import path from "node:path"; |
2 | 2 |
|
3 | 3 | import { RE_CAMEL_CASE, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE } from "@eslint-react/shared"; |
4 | | -import { isObject, isString } from "@eslint-react/tools"; |
| 4 | +import { isString } from "@eslint-react/tools"; |
5 | 5 | import type { JSONSchema4 } from "@typescript-eslint/utils/json-schema"; |
6 | 6 | import { camelCase, kebabCase, pascalCase, snakeCase } from "string-ts"; |
7 | 7 | import { match } from "ts-pattern"; |
@@ -38,7 +38,7 @@ type Options = readonly [ |
38 | 38 | const defaultOptions = [ |
39 | 39 | { |
40 | 40 | excepts: ["^index$"], |
41 | | - extensions: [".jsx", ".tsx"], |
| 41 | + extensions: [".js", ".jsx", ".ts", ".tsx"], |
42 | 42 | rule: "PascalCase", |
43 | 43 | }, |
44 | 44 | ] as const satisfies Options; |
@@ -93,15 +93,15 @@ export default createRule<Options, MessageID>({ |
93 | 93 | const rule = isString(options) ? options : options.rule ?? "PascalCase"; |
94 | 94 | // eslint-disable-next-line @typescript-eslint/no-deprecated |
95 | 95 | const excepts = isString(options) ? [] : options.excepts ?? []; |
96 | | - const extensions = isObject(options) && "extensions" in options |
97 | | - // eslint-disable-next-line @typescript-eslint/no-deprecated |
98 | | - ? options.extensions |
99 | | - : defaultOptions[0].extensions; |
| 96 | + // const extensions = isObject(options) && "extensions" in options |
| 97 | + // // eslint-disable-next-line @typescript-eslint/no-deprecated |
| 98 | + // ? options.extensions |
| 99 | + // : defaultOptions[0].extensions; |
100 | 100 |
|
101 | 101 | const filename = context.filename; |
102 | | - const fileNameExt = filename |
103 | | - .slice(filename.lastIndexOf(".")); |
104 | | - if (!extensions.includes(fileNameExt)) return {}; |
| 102 | + // const fileNameExt = filename |
| 103 | + // .slice(filename.lastIndexOf(".")); |
| 104 | + // if (!extensions.includes(fileNameExt)) return {}; |
105 | 105 |
|
106 | 106 | function validate(name: string, casing: Case = rule, ignores: readonly string[] = excepts) { |
107 | 107 | if (ignores.map((pattern) => new RegExp(pattern, "u")).some((pattern) => pattern.test(name))) { |
|
0 commit comments