@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-devCopy the
peerDependenciessection from thepackage.jsonfile into thedevDependenciessection in your project'spackage.jsonand runnpm installAdd 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
overrideskey:[ { 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
filesarray. 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:eslintand 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
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago