The project uses ESLint with TypeScript type-checking and Prettier integration. The configuration targets files in src/**/*.ts and applies recommended rules from @eslint/js and typescript-eslint.
Key configuration details:
- Parser Options: Uses
projectService: true and sets tsconfigRootDir to the current directory for type-aware linting. - Globals: Configured for a Node.js environment.
- Ignored Paths:
dist/**, node_modules/**, .cache/**, and *.d.ts files are excluded from linting. - Plugins: Includes
eslint-plugin-n (Node.js plugin) and eslint-config-prettier to prevent conflicts with formatting.
import js from '@eslint/js';
import globals from 'globals';
import n from 'eslint-plugin-n';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
export default tseslint.config(
{
ignores: ['dist/**', 'node_modules/**', '.cache/**', '*.d.ts'],
},
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
files: ['src/**/*.ts'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: globals.node,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
n,
},
rules: {
// ... rules
},
},
eslintConfigPrettier,
);