Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const task: TaskFn = (absPath) => {
const tsconfig = new JsonFile(absPath, 'tsconfig.json')
tsconfig.set('include', ['**/*'])
tsconfig.set('exclude', ['node_modules', 'build'])
tsconfig.set('extends', './node_modules/adonis-preset-ts/tsconfig')
tsconfig.set('compilerOptions', {
outDir: 'build',
rootDir: './',
sourceMap: true,
paths: {
'App/*': ['./app/*'],
'Contracts/*': ['./contracts/*'],
},
})
tsconfig.commit()
const task: TaskFn = (absPath, _app, state) => {
if (!state.eslint) {
return
}
const eslint = new JsonFile(absPath, '.eslintrc.json')
eslint.set('extends', ['plugin:adonis/typescriptApp'])
eslint.commit()
const eslintIgnore = new LinesFile(absPath, '.eslintignore')
eslintIgnore.add('build')
eslintIgnore.commit()
logger.create('.eslintrc.json, .eslintignore')
}