tiny-vue/linting/resolve-config.js

29 lines
717 B
JavaScript

/* eslint-env node */
const baseConfig = require('../.eslintrc')
/**
* @param {import('typescript').Program} program
* @returns {import('eslint').Linter.Config}
*/
module.exports = program => ({
...baseConfig,
parserOptions: {
tsconfigRootDir: process.cwd(),
project: ['./tsconfig.eslint.json'],
programs: [program], // replace eslint typescript program
},
// ignore non-ts virtual files that was generated by volar
ignorePatterns: ['**/*.vue.*'],
overrides: [
...baseConfig.overrides ?? [],
{
// ignore invalid errors for volar code
files: ['*.vue.ts', '*.vue.js', '*.vue.tsx', '*.vue.jsx'],
rules: {
'prettier/prettier': 'off',
},
},
],
})