lint-staged.config.js 468 字节
Newer Older
1 2
const path = require('path');

3
module.exports = {
4 5 6 7 8 9 10 11
    '**/*.ts?(x)': async filenames =>
        [
            ...new Set(
                filenames.map(
                    filename => path.relative(path.join(process.cwd(), 'packages'), filename).split(path.sep)[0]
                )
            )
        ].map(p => `tsc -p ${path.join(process.cwd(), 'packages', p, 'tsconfig.json')} --noEmit`),
12
    '**/*.(j|t)s?(x)': filenames => `eslint ${filenames.join(' ')}`
13
};