@stefanolazzaroni/eslint-config
v0.0.2
Published
StefanoLazzaroni ESLint extensible configuration
Maintainers
Readme
@stefanolazzaroni/eslint-config
Shared ESLint & Prettier extensible configuration
Installation
npm install -D @stefanolazzaroni/eslint-configNote eslint, prettier, typescript are a peer dependencies
Prettier config
prettier.config.js
module.exports = require('@stefanolazzaroni/eslint-config/prettierrc.json');ESLint config
React
create eslint.config.mjs
import tsParser from '@typescript-eslint/parser';
import { defineConfig, globalIgnores } from 'eslint/config';
import react from '@stefanolazzaroni/eslint-config/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([
globalIgnores(['dist/**', '/node_modules/**', 'eslint.config.mjs']),
{
extends: [react],
languageOptions: {
parser: tsParser,
parserOptions: {
tsconfigRootDir: __dirname,
projectService: true,
},
},
},
]);Next
create eslint.config.mjs
import tsParser from '@typescript-eslint/parser';
import { defineConfig, globalIgnores } from 'eslint/config';
import next from '@stefanolazzaroni/eslint-config/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([
globalIgnores(['dist/**', '/node_modules/**', 'eslint.config.mjs']),
{
extends: [next],
languageOptions: {
parser: tsParser,
parserOptions: {
tsconfigRootDir: __dirname,
projectService: true,
},
},
},
]);Nest
create eslint.config.mjs
import tsParser from '@typescript-eslint/parser';
import { defineConfig, globalIgnores } from 'eslint/config';
import nest from '@stefanolazzaroni/eslint-config/nest';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default defineConfig([
globalIgnores(['dist/**', '/node_modules/**', 'eslint.config.mjs']),
{
extends: [nest],
languageOptions: {
parser: tsParser,
parserOptions: {
tsconfigRootDir: __dirname,
projectService: true,
},
},
},
]);