UNPKG

@lego/eslint-config-react

Version:

LEGO shareable eslint config for js projects

30 lines (26 loc) 690 B
import { Linter } from 'eslint'; process.env.LEGO_ESLINT_CONFIG_REACT = 'on'; const config: Linter.Config = { extends: [ './rules/react', // all react rules, explicitely set './rules/react-hooks', // lego react-hooks configuration ], parserOptions: { ecmaFeatures: { jsx: true, }, ecmaVersion: 2018, sourceType: 'module', }, plugins: ['react', 'react-hooks'], rules: { 'node/no-missing-import': ['error', { tryExtensions: ['.js', '.jsx', '.ts', '.tsx'] }], }, settings: { 'import/extensions': ['.js', '.ts', '.jsx', '.tsx'], 'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'], }, }, }; export = config;