How to use the @adonisjs/sink.JsonFile function in @adonisjs/sink

To help you get started, we’ve selected a few @adonisjs/sink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AdonisCommunity / create-adonis-ts-app / tasks / createTsConfig.ts View on Github external
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()
github AdonisCommunity / create-adonis-ts-app / tasks / createEslint.ts View on Github external
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')
}