Key Features • How To Use • Credits • Features Under Development • License
There is a lot of confusion about how to get Prettier
and ESLint to work together. I wanted to create a tool
that will automagically implement the recommended configurations of ESLint to
work with Prettier. I also wanted it to work similar to eslint --init
To start with, the only mention ESLint makes of Prettier is on their GitHub page's FAQ Section, but no further directions.
Prettier makes
two methodologies
available to integrate with ESLint, but one
isn't recommended.
Furthermore, the suggested
additional package
requires configurations of the .eslintrc.*
file mentioned in the
instructions!
This is a bunch of steps that can and now is automated.
- Updates .eslintrc.js file with correct prettier extends for known plugins
- supports the following plugins
@typescript-eslint/eslint-plugin
eslint-plugin-babel
eslint-plugin-flowtype
eslint-plugin-prettier
eslint-plugin-react
eslint-plugin-standard
eslint-plugin-unicorn
eslint-plugin-vue
- supports the following plugins
- Determines and installs missing npm packages for the configuration of ESLint
- prettier
- eslint-config-prettier
- If you haven't already, create a
.eslintrc.js
file manually or runnpx eslint --init
- run
npx auto-config-eslint-for-prettier
This software uses the following open source packages:
- Chai
- ESLint
- chai-as-promised
- coveralls
- eslint-config-airbnb-base
- eslint-config-prettier
- eslint-plugin-import
- eslint-plugin-jsdoc
- Generate Changelog
- Husky
- Mocha
- Node.js
- nyc
- Prettier
- Sinon.js
- Detect if ESLint isn't setup yet
- Support eslintrc in YAML format
- Support eslintrc in JSON format
- Optionally auto install of Prettier and/or eslint-config-prettier
- Add ability to download json(c) rules, from pre-defined keywords
- Add ability to download json(c) rules, from arbitrary URLs
- Add ability to read json(c) rules, from a local path
MIT
aaronyoung.dev · GitHub @brainomite