diff --git a/package.json b/package.json index debb674..52ff5e3 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,8 @@ "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@types/supertest": "^6.0.2", - "@typescript-eslint/eslint-plugin": "^8.16.0", - "@typescript-eslint/parser": "^8.16.0", + "@typescript-eslint/eslint-plugin": "^8.17.0", + "@typescript-eslint/parser": "^8.17.0", "@typescript-eslint/utils": "^8.16.0", "@vitejs/plugin-react": "^4.3.4", "c8": "^10.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 072bbb5..839478e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,10 +81,10 @@ importers: specifier: ^6.0.2 version: 6.0.2 '@typescript-eslint/eslint-plugin': - specifier: ^8.16.0 + specifier: ^8.17.0 version: 8.17.0(@typescript-eslint/parser@8.17.0(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2) '@typescript-eslint/parser': - specifier: ^8.16.0 + specifier: ^8.17.0 version: 8.17.0(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2) '@typescript-eslint/utils': specifier: ^8.16.0 diff --git a/src/commitlint/index.js b/src/commitlint/index.js index 64bb6c6..9a1035c 100644 --- a/src/commitlint/index.js +++ b/src/commitlint/index.js @@ -39,7 +39,7 @@ export const commitLintConfig = { }; export const commitLintReferenceRequiredConfig = { - ...commitLintConfig, + extends: ['@commitlint/config-conventional'], rules: { ...commitLintConfig.rules, 'references-empty': [2, 'never'], diff --git a/src/eslint/constants.js b/src/eslint/constants.js index e2a9ec3..abded8a 100644 --- a/src/eslint/constants.js +++ b/src/eslint/constants.js @@ -7,6 +7,7 @@ * Explore our open-source projects: {@link https://github.com/kurocado-studio} */ import babelParser from '@babel/eslint-parser'; +import typescriptPlugin from '@typescript-eslint/eslint-plugin'; import typescriptParser from '@typescript-eslint/parser'; import prettierConfig from 'eslint-config-prettier'; import eslintPluginImport from 'eslint-plugin-import'; @@ -73,6 +74,7 @@ export const javascriptLanguageOptions = { export const typescriptLanguageRootConfig = { ...typescriptLanguageOptions, plugins: { + '@typescript-eslint': typescriptPlugin, import: eslintPluginImport, prettier: prettierConfig, tsdoc: tsdocRecommended, diff --git a/src/eslint/rules/typescript/index.js b/src/eslint/rules/typescript/index.js index 308008a..04fe696 100644 --- a/src/eslint/rules/typescript/index.js +++ b/src/eslint/rules/typescript/index.js @@ -60,27 +60,13 @@ export const typescriptEslintConfig = { '@typescript-eslint/naming-convention': [ 'error', // Anything type-like should be written in PascalCase. - { - format: ['PascalCase'], - selector: ['typeLike', 'enumMember'], - }, - // Interfaces cannot be prefixed with `I`, or have restricted names. - { - custom: { - match: false, - regex: '^I[A-Z]|^(Interface|Props|State)$', - }, - format: ['PascalCase'], - selector: 'interface', - }, - // Types cannot be prefixed with`T ` or have restricted names. { custom: { match: false, - regex: '^T[A-Z]|^(Type|Props|State)$', + regex: '^T[A-Z]|^(Type|Props|State|Interface)$', }, format: ['PascalCase'], - selector: 'type', + selector: ['typeLike', 'typeAlias', 'enumMember'], }, ], /** diff --git a/src/index.js b/src/index.js index 57ec7a0..a629fc3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,7 @@ -export { commitLintConfig } from './commitlint/index.js'; +export { + commitLintConfig, + commitLintReferenceRequiredConfig, +} from './commitlint/index.js'; export { eslintBaseConfig } from './eslint/eslint.base.js'; export { eslintBrowserConfig } from './eslint/eslint.browser.js';