facile.it ESLint extensible configuration
npm install eslint-config-facilefacile.it ESLint & Prettier extensible configuration
``sh`
npm install -D eslint-config-facile eslint prettier
Note eslint, prettier, typescript are a peer dependencies
_create .prettierrc.js_
`js`
module.exports = require('eslint-config-facile/prettierrc.json')
_create eslint.config.mjs_
`ts
import { defineConfig } from 'eslint/config'
import react from 'eslint-config-facile/react'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
export default defineConfig([
react,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname, // or only import.meta.dirname, available after Node.js v20.11.0
},
},
},
])
`
_create eslint.config.mjs_
`ts
import { defineConfig } from 'eslint/config'
import next from 'eslint-config-facile/next'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
export default defineConfig([
next,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname, // or only import.meta.dirname, available after Node.js v20.11.0
},
},
},
])
`
_create eslint.config.mjs_
`ts
import { defineConfig } from 'eslint/config'
import node from 'eslint-config-facile/node'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
export default defineConfig([
node,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname, // or only import.meta.dirname, available after Node.js v20.11.0
},
},
},
])
``