Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-config-xx

freeshineit921MIT2.0.1

eslint config xx

eslint, eslint-config, prettier, prettier config

readme

eslint-config-xx

Download Version License

Support js/ts/jsx/tsx and export prettier config

install

yarn install eslint-config-xx -D

eslint config

eslint.config.js

// import js from '@eslint/js';
// import globals from 'globals';
// import reactHooks from 'eslint-plugin-react-hooks';
// import reactRefresh from 'eslint-plugin-react-refresh';
import { defineConfig, globalIgnores } from 'eslint/config';
import configs from 'eslint-config-xx';

export default defineConfig([
  globalIgnores(['dist']),
  ...configs,
  // {
  //   files: ['**/*.{js,jsx}'],
  //   extends: [js.configs.recommended, reactHooks.configs['recommended-latest'], reactRefresh.configs.vite],
  //   languageOptions: {
  //     ecmaVersion: 2020,
  //     globals: globals.browser,
  //     parserOptions: {
  //       ecmaVersion: 'latest',
  //       ecmaFeatures: { jsx: true },
  //       sourceType: 'module',
  //     },
  //   },
  //   rules: {
  //     'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
  //   },
  // },
]);

prettier config

prettier.config.mjs

import configs from 'eslint-config-xx/prettier.config.mjs';

export default configs;

js 项目

Parsing error: project was set to true but couldn't find any tsconfig.json relative

在根目录下新建tsconfig.json

{
  "compilerOptions": {
    "module": "esnext",
    "target": "ES2015",
    "lib": ["es6", "dom", "es2016", "es2017"],
    "sourceMap": true,
    "allowJs": true,
    "outDir": "dist",
    "moduleResolution": "node",
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "jsx": "react-jsx"
  },
  "include": ["./eslint.config.js", "./prettier.config.mjs"],
  "exclude": ["node_modules"]
}

changelog

v1.8.0 (2024-02-17)

chore: update deps

chore: remove node 16 support

v1.3.0 (2023-10-17)

chore: update deps

v1.2.0 (2023-10-02)

feat: support typescript@5.2 and node minimum version 16

v1.1.8 (2023-07-09)

feat: support typescript@5.1