Skip to content

facile-it/eslint-config-facile

Repository files navigation

ESlint-config-facile

facile.it ESLint & Prettier extensible configuration

Installation

npm install -D eslint-config-facile eslint prettier

Note eslint, prettier, typescript are a peer dependencies

Prettier config

create .prettierrc.js

module.exports = require('eslint-config-facile/prettierrc.json')

ESLint config

React

create eslint.config.mjs

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
            },
        },
    },
])

Next

create eslint.config.mjs

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
            },
        },
    },
])

Node

create eslint.config.mjs

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
            },
        },
    },
])

About

eslint-config-facile

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5