@adonisjs/eslint-config
v3.0.0
Published
The base configuration for ESLint used by AdonisJS applications and packages
Readme
@adonisjs/eslint-config
Compatible with ESLint 9.0 and Prettier 3.0
Installation
Install the package from the npm registry.
npm i -D @adonisjs/eslint-config@beta
# Install peer dependencies
npm i -D eslint@9 prettier@3Usage
After installation, use one of the following presets depending on the nature of your application/library.
For package development: Use the following preset when developing a package
// eslint.config.js
import { configPkg } from '@adonisjs/eslint-config'
export default configPkg()For app development: Use the following preset when developing an AdonisJS application
// eslint.config.js
import { configApp } from '@adonisjs/eslint-config'
export default configApp()Inertia support
If @adonisjs/inertia is installed, the following rules will be automatically enabled for files in inertia/**:
@adonisjs/no-backend-import-in-frontend: Prevents importing backend code in frontend files@adonisjs/prefer-adonisjs-inertia-link: Suggests using AdonisJS typesafe<Link>component instead of Inertia's<Link>component
Adding additional config blocks
You can pass additional config blocks as multiple arguments to one of the preset functions.
import { configApp, INCLUDE_LIST, GLOBAL_IGNORE_LIST } from '@adonisjs/eslint-config'
export default configApp({
name: 'Custom config',
files: INCLUDE_LIST,
ignores: GLOBAL_IGNORE_LIST,
plugins: {
// ESLint plugins go here
},
rules: {
// ESLint rules go here
},
})