NodeSwift uses ESLint with TypeScript support via typescript-eslint. The configuration applies recommended and stylistic rules and is configured to use the TypeScript project service for type-aware linting.
Key configuration details:
- Parser Options: Uses
projectService: true and sets tsconfigRootDir to the current directory to enable efficient type-checking during linting. - Ignored Directories: The following directories are excluded from linting:
dist, lib, test, example, and eslint.config.mjs. - Custom Rules:
@typescript-eslint/no-explicit-any is set to off.@typescript-eslint/no-inferrable-types is set to off.
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.stylistic,
{
ignores: [
'dist',
'lib',
'test',
'example',
'eslint.config.mjs',
],
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
},
},
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
);