@redguy12/eslint-plugin v4.1.1
@redguy12/eslint-plugin
My ESLint Style Guide
Adding To A Project
Install the plugin by running:
npm install @redguy12/eslint-plugin --save-dev
Copy the
peerDependencies
section from thepackage.json
file into thedevDependencies
section in your project'spackage.json
and runnpm install
Add a .eslintrc.js file with the following contents:
"use strict"; /** @file ESLint Configuration file. */ require("@rushstack/eslint-patch/modern-module-resolution"); module.exports = { "root": true, extends: ["plugin:@redguy12/recommended"], };
Add overrides for specific files by adding an
overrides
key:[ { extends: ["plugin:@redguy12/node"], // Node.JS scripts files: [], }, { extends: ["plugin:@redguy12/esm"], // ESM files files: ["**.mjs", "*.mjs"], }, { extends: ["plugin:@redguy12/cli"], // CLIs (including JS GitHub Actions) files: ["bin/**.js", "bin/*.js", ".github/**.js", ".github/*.js"], }, { extends: ["plugin:@redguy12/config"], // Configuration files files: [ "**.config.js", "*.config.js", "**rc.js", "*rc.js", "**.config.mjs", "*.config.mjs", "**rc.mjs", "*rc.mjs", "**.config.cjs", "*.config.cjs", "**rc.cjs", "*rc.cjs", ], }, { extends: ["plugin:@redguy12/browser"], // Client-side scripts (including HTML files) files: ["**.html", "*.html", "**.htm", "*.htm", "**.md/*.html", "*.md/*.html"], }, { extends: ["plugin:@redguy12/vue"], // Vue templates files: ["*.vue", "**.vue"], }, { extends: ["plugin:@redguy12/sample"], // Files including samples (AKA docs) (including HTML and Markdown files) files: ["**.md", "*.md", "**.md/*", "*.md/*"], }, { "extends": ["plugin:@redguy12/ts"], // TypeScript files "files": [ "*.ts", "**.ts" ], }, ];
You can remove any objects that have an empty or unchanged
files
array. However, please make sure that the entries stay in this order.Add project-specific configuration (such as
ecmaVersion
). (You should not need to add more rules; it'd probably be better to update the plugin in that case).Add an npm script to lint your code. It should be named
lint:eslint
and have the following content:eslint --fix --cache .
To lint your code, simply run
npm run lint:eslint
Congrats! You've successfully integrated ESLint into your project with @redguy12/eslint-plugin!
For All
While this was made specifically for me, anyone can use it! If you have any feedback or require support, please open a discussion and I will get back to you as soon as I can.
Contributing
Feel free to open pull requests, but don't be surprised when we close them. This project rarely changes. However, if you really feel like it should change, open an issue so we can discuss it!
Authors
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago