kdu-tsc-eslint-hook
v1.2.0
Published
Use ESLint with kdu-tsc to have better performance and accuracy.
Downloads
10
Readme
kdu-tsc-eslint-hook
Use ESLint with kdu-tsc to have better performance and accuracy.
Usage
package.json
{
"devDependencies": {
"eslint": "latest",
"kdu-tsc": "latest",
"kdu-tsc-eslint-hook": "latest"
}
}
tsconfig.json
{
"kduCompilerOptions": {
"hooks": [
"./kdu-tsc-hook.js"
]
}
}
kdu-tsc-hook.js
module.exports = (program) =>
require('kdu-tsc-eslint-hook')(
program,
(program) => ({
...baseConfig,
parserOptions: {
...baseConfig.parserOptions,
programs: [program], // replace eslint typescript program
},
// ignore non-ts virtual files that was generated by kocan
ignorePatterns: ['**/*.kdu', '**/*.html', '**/*.pug', '**/*.css', '**/*.scss'],
overrides: [
...baseConfig.overrides ?? [],
{
// ignore format linting for virtual ts code
files: ['*.kdu.ts', '*.kdu.js', '*.kdu.tsx', '*.kdu.jsx'],
rules: {
'prettier/prettier': 'off',
},
},
],
})
)