eslintrc-generator
A simple CLI tool to create .eslintrc.json file perfectly compatible with your project and code formatter Prettier
Answer some simple questions and get your RC file as well as all the packages installed
NPM Package
·
Report Bug
·
Request Feature
Eslintrc-Generator is a simple but time-saving command-line tool that will help you setup your eslint, project, and code formatter with all the configuration you want. You just have to answer some really simple questions and this tool will do all the heavy lifting for you creating the file according to config and installing all the packages
💡 Features
- Uses Airbnb Style Guide
- Perfectly compatible with
- TypeScript
- JavaScript
- Prettier
- React
- Ask questions and creates config based on your choice
- You have complete control over the configuration
- Checks for package.json file and
npm init -y
if not found - Installs all required packages as dev dependency as per the config
- Uses your preferred package manager
- Supports CLI arguments
⛏️ Built with
- Inquirer
- Listr
- Execa
- Yargs
💻 Command Line Arguments
- -t, --moduleType: Module type you use [ js: JavaScript modules (Import/Export), req: CommonJS (require)] { choices: "js", "req", "none" }
- -c, --codeRun: Code will run on [array] { choices: "browser", "node" }
- -r, --isReact: Using React in project [boolean]
- -l, --language: Language you going to use { choices: "ts", "js" }
- -p, --isPrettier: Using Prettier for formatting [boolean]
- -m, --packageManager: Which package manager to use { choices: "yarn", "npm" }
🏁 Getting Started
Follow all these instructions and learn the best way to take benefits from this package.
📚 Prerequisite
- Node
- npm/yarn
🧰 Installation
-
Global installation (preferred way)
npm i eslintrc-generator -g
Note: Global installation is not possible with yarn v2 as far as I know, (please guide me if I am wrong). If you are using yarn v1 then use
yarn global add eslintrc-generator
. And I recommend using the global method -
Per project installation
npm i eslintrc-generator or yarn add eslintrc-generator
-
Command to generate RC file
npx eslintrc-generator or generate-eslintrc
-
Generate via CLI arguments
npx eslintrc-generator -t js -c node -l ts -m yarn -rp or generate-eslintrc -t js -c node -l ts -m yarn -rp
-
🎈 Usage
The sole motive of this package is to improve Developer Experience. The package is made to save time configuring Eslint and Prettier, with your project (if you have done this before you already know the pain). The tool will ask you certain questions, prepare a config and required packages list based on your answers, install all the packages and create the RC file perfectly compatible with your project as well as Prettier. You just need to focus on your awesome project.
✍️ Authors
- @DeeshanSharma - Idea & Initial Work
📖 Contributing
"In real open source, you have the right to control your own destiny." - Linus Torvalds
Contributions are what makes the open-source community an amazing place. Any contributions you make are greatly appreciated.
💳 License
Distributed under the MIT License. See LICENSE
for more information.
🧬 Resources
- Airbnb Style Guide
- NPM Docs - Creating Node.js modules
- Twilio Guide - How to build a CLI with Node.js
🎉 Acknowledgement
👋 EndNote
Star this project so you don't miss it when you need it and avoid wasting time Googling the stuff and just focus on the build.