abhijithvijayan / eslint-config

My shared ESLint & Prettier configuration for projects

Home Page:https://www.npmjs.com/package/@abhijithvijayan/eslint-config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

migration from eslint-config-onepass

abhijithvijayan opened this issue · comments

This package was initially called eslint-config-onepass

The module is now deprecated in favour of @abhijithvijayan/eslint-config

Differences

  • Dropped support for eslint-plugin-html
  • Uses Separate modules for react, javascript, typescript, etc...
  • Add new eslint rules
  • Highly customisable and pluggable

See @abhijithvijayan/eslint-config README for more info

Migration Instruction: #1 (comment)

Migration guide

Migration is just so simple. A couple of uninstalls/installs/updates is all it takes.

Follow these steps

  1. Remove everything. (Just to fix the dependency issues)
npm uninstall eslint-config-onepass babel-eslint eslint eslint-config-prettier eslint-config-airbnb eslint-plugin-html eslint-plugin-prettier eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react prettier eslint-plugin-react-hooks
  1. Install @abhijithvijayan/eslint-config
# npm
npx install-peerdeps @abhijithvijayan/eslint-config --dev

# yarn
npx install-peerdeps @abhijithvijayan/eslint-config --dev --yarn
  1. Update .eslintrc.json

    note: This comes with different types of modules exposed

    1. JavaScript only projects

      {
        "extends": [
          "@abhijithvijayan/eslint-config"
        ],
        "rules": {
          // your overrides
        }
      }
      
    2. JavaScript + React.js

      {
        "extends": [
          "@abhijithvijayan/eslint-config",
          "@abhijithvijayan/eslint-config/react",
        ],
        "rules": {
          // your overrides
        }
      }
      

    If you need TypeScript / Node config, follow https://github.com/abhijithvijayan/eslint-config#typescript

  2. Update scripts in package.json

"scripts": {
    // other scripts
    "lint": "eslint . --ext .js,.ts,.tsx",
    "lint:fix": "eslint . --ext .js,.ts,.tsx --fix"
},

Happy linting 🎉

Comment here if facing any problems.