diff --git a/eslint.config.js b/eslint.config.js index fecb9e9..542b62e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,8 +1,7 @@ import { defineConfig } from 'readable'; export default defineConfig({ - strict: true, - tsconfig: '/home/work/Documents/Repositories/Readable/tsconfig.json', + tsconfig: ['./tsconfig.json', './packages/*/tsconfig.json', './packages/*/jsconfig.json'], environment: { node: true, }, diff --git a/packages/core/jsconfig.json b/packages/core/jsconfig.json new file mode 100644 index 0000000..d4e37f4 --- /dev/null +++ b/packages/core/jsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../tsconfig.json", + "exclude": ["./node_modules/**", "./dist/**"], + "include": ["./index.d.ts", "./src/**/*.ts", "./src/**/*.js"], +} diff --git a/packages/core/src/@types/typescript-eslint.d.ts b/packages/core/src/@types/typescript-eslint.d.ts new file mode 100644 index 0000000..b01e94e --- /dev/null +++ b/packages/core/src/@types/typescript-eslint.d.ts @@ -0,0 +1,46 @@ +import type { ESLint, Linter } from 'eslint'; + +/** + * @see {@link https://www.npmjs.com/package/@typescript-eslint/eslint-plugin npm package} + * @summary An ESLint plugin which provides lint rules for TypeScript codebases. + * + * --- + * **Note:** Types in this project where overridden to be compatible with ESLint new flat + * config types. ESlint already has backwards compatibility for plugins not created in the + * new flat config. + */ +declare module '@typescript-eslint/eslint-plugin' { + interface typescriptEslintPlugin extends ESLint.Plugin { + configs: { + recommended: { + rules: Linter.RulesRecord + } + 'recommended-requiring-type-checking': { + rules: Linter.RulesRecord + } + 'eslint-recommended': { + rules: Linter.RulesRecord + } + strict: { + rules: Linter.RulesRecord + } + } + } + declare const plugin: typescriptEslintPlugin; + export default plugin; +} + +/** + * @see {@link https://www.npmjs.com/package/@typescript-eslint/parser npm package} + * @summary An ESLint parser which leverages TypeScript ESTree to allow for ESLint + * to lint TypeScript source code. + * + * --- + * **Note:** Types in this project where overridden to be compatible with ESLint new flat + * config types. ESlint already has backwards compatibility for parsers not created in the + * new flat config. + */ +declare module '@typescript-eslint/parser' { + declare const parser: Linter.ParserModule; + export default parser; +}