All Projects → EvgenyOrekhov → eslint-config-hardcore

EvgenyOrekhov / eslint-config-hardcore

Licence: MIT license
The most strict (yet practical) ESLint config. 34 plugins. 1047 rules.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
typescript
32286 projects

Projects that are alternatives of or similar to eslint-config-hardcore

eslint-define-config
Provide a defineConfig function for .eslintrc.js files
Stars: ✭ 61 (-63.69%)
Mutual labels:  config, eslint, eslint-config, eslintconfig
eslint-config-adjunct
A reasonable collection of plugins to use alongside your main esLint configuration
Stars: ✭ 39 (-76.79%)
Mutual labels:  eslint, prettier, eslint-config
eslint-config
My shared ESLint & Prettier configuration for projects
Stars: ✭ 12 (-92.86%)
Mutual labels:  eslint, prettier, eslint-config
luozhu
Luozhu's practice in Front End Engineering and Components Development.
Stars: ✭ 28 (-83.33%)
Mutual labels:  eslint, prettier, eslintconfig
eslint-config
An ESLint shareable config that I used in my projects
Stars: ✭ 15 (-91.07%)
Mutual labels:  eslint, eslint-config, eslintconfig
Eslint Config Prettier
Turns off all rules that are unnecessary or might conflict with Prettier.
Stars: ✭ 3,471 (+1966.07%)
Mutual labels:  eslint, prettier, eslint-config
Eslint Config Kit
A collection of useful eslint configs
Stars: ✭ 39 (-76.79%)
Mutual labels:  config, eslint, prettier
figma-plugin-typescript-boilerplate
Figma plugin TypeScript boilerplate to start developing right away
Stars: ✭ 43 (-74.4%)
Mutual labels:  eslint, prettier
bradgarropy.com
🏠 my home on the web
Stars: ✭ 58 (-65.48%)
Mutual labels:  eslint, prettier
generator-bunny
🐰 Jumpstart node module, like a bunny!
Stars: ✭ 13 (-92.26%)
Mutual labels:  eslint, prettier
awesome-vue-boilerplate
😍 Awesome Vue Boilerplate 🥳 Vue 🥰 Vuex, vuex-pathify 🤗 element-ui 🤲 tailwindcss
Stars: ✭ 60 (-64.29%)
Mutual labels:  eslint, prettier
vue-antdesign-admin-template
Ant Design Pro Vue Template
Stars: ✭ 127 (-24.4%)
Mutual labels:  eslint, prettier
eslint-config-welly
😎 ⚙️ ESLint configuration for React projects that I do. Feel free to use this!
Stars: ✭ 21 (-87.5%)
Mutual labels:  prettier, eslint-config
typescript-api-starter
🔰 Starter for Node.js express API in Typescript 🚀
Stars: ✭ 72 (-57.14%)
Mutual labels:  eslint, prettier
eslint-config-typescript-unified
🛠️ A unified ESLint configuration with sensible defaults for TypeScript projects.
Stars: ✭ 15 (-91.07%)
Mutual labels:  prettier, eslint-config
reactjs-vite-tailwindcss-boilerplate
ReactJS + Vite boilerplate to be used with Tailwindcss.
Stars: ✭ 103 (-38.69%)
Mutual labels:  eslint, prettier
wemake-frontend-styleguide
Set of the strictest linters for your next frontend app
Stars: ✭ 67 (-60.12%)
Mutual labels:  eslint-config, code-quality
web-build-tool-demo
比较全面的前端构建工具demo,拿来即练,不定时更新,包含git npm gulp webpack babel typescript husky eslint tslint lint-stage prettier等
Stars: ✭ 42 (-75%)
Mutual labels:  eslint, prettier
zero
📦 A zero config scripts library
Stars: ✭ 17 (-89.88%)
Mutual labels:  eslint, prettier
Express-REST-API-Template
Minimal starter project for a Node.js RESTful API based off express generator
Stars: ✭ 26 (-84.52%)
Mutual labels:  eslint, prettier

eslint-config-hardcore

npm code style: prettier

The most strict (yet practical) ESLint config.

Aims to include as many plugins and rules as possible to make your code extremely consistent and robust.

34 plugins. 1047 rules.

Usage

npm install eslint-config-hardcore --save-dev

Available configs:

  • hardcore - base framework-agnostic config
  • hardcore/ts - additional config for TypeScript
  • hardcore/node- additional config for Node.js
  • hardcore/react - additional config for React
  • hardcore/react-testing-library - additional config for React Testing Library
  • hardcore/jest - additional config for Jest
  • hardcore/fp - additional config for functional programming
  • hardcore/ts-for-js - additional config for linting JavaScript with typescript-eslint

Example .eslintrc.json for a React project:

{
  "extends": [
    "hardcore",
    "hardcore/react",
    "hardcore/react-testing-library",
    "hardcore/jest",
    "hardcore/fp"
  ],

  "env": {
    "browser": true
  },

  "overrides": [
    {
      "files": ["server/**/*.js"],
      "extends": ["hardcore/node"],
      "env": {
        "browser": false
      }
    }
  ]
}

Example .eslintrc.json for a TypeScript React project:

{
  "extends": [
    "hardcore",
    "hardcore/react",
    "hardcore/react-testing-library",
    "hardcore/jest",
    "hardcore/fp",
    "hardcore/ts"
  ],

  "parserOptions": {
    "project": "./tsconfig.json"
  },

  "env": {
    "browser": true
  },

  "overrides": [
    {
      "files": ["server/**/*.ts"],
      "extends": ["hardcore/node"],
      "env": {
        "browser": false
      }
    }
  ]
}

Configs

hardcore

Base framework-agnostic config.

Plugin Enabled rules
ESLint core rules 187
eslint-plugin-putout 91
eslint-plugin-prettier 84
eslint-plugin-unicorn 84
eslint-plugin-regexp 69
eslint-plugin-import 34
eslint-plugin-sonarjs 31
HTML ESLint 21
eslint-plugin-promise 12
eslint-plugin-security 11
eslint-plugin-array-func 4
eslint-plugin-eslint-comments 6
eslint-plugin-no-constructor-bind 2
@shopify/eslint-plugin 1
eslint-plugin-no-use-extend-native 1
eslint-plugin-ext 1
eslint-plugin-anti-trojan-source 1
eslint-plugin-json¹ 1
Total: 641

¹ eslint-plugin-json actually includes 19 rules, but I consider them as one "no-invalid-json" rule.

hardcore/ts

Config for TypeScript.

Plugin Enabled rules
typescript-eslint 103
eslint-plugin-etc 10
@shopify/eslint-plugin 3
eslint-plugin-sort-class-members 1
eslint-plugin-no-explicit-type-exports 1
Total: 118

hardcore/node

Config for Node.js.

Plugin Enabled rules
eslint-plugin-node 35
Total: 35

hardcore/react

Config for React.

Plugin Enabled rules
eslint-plugin-react 79
eslint-plugin-jsx-a11y 32
eslint-plugin-react-perf 4
eslint-plugin-react-form-fields 4
@shopify/eslint-plugin 3
eslint-plugin-react-hook-form 3
eslint-plugin-react-hooks 2
Total: 127

hardcore/react-testing-library

Config for React Testing Library.

Plugin Enabled rules
eslint-plugin-testing-library 25
Total: 25

hardcore/jest

Config for Jest.

Plugin Enabled rules
eslint-plugin-jest 46
eslint-plugin-jest-dom 11
eslint-plugin-jest-formatting 7
Total: 64

hardcore/fp

Config for functional programming.

Plugin Enabled rules
eslint-plugin-fp 13
eslint-plugin-ramda 24
Total: 37

hardcore/ts-for-js

Config for linting JavaScript with typescript-eslint.

Plugin Enabled rules
typescript-eslint 27
@shopify/eslint-plugin 2
eslint-plugin-sort-class-members 1
Total: 30

Did you know you can lint JavaScript code with typescript-eslint?

Use this config to take advantage of typescript-eslint's advanced type-aware rules (like @typescript-eslint/naming-convention and @typescript-eslint/prefer-optional-chain) without the need to switch to writing TypeScript.

  1. First, you'll need to create tsconfig.json in the root of your project. You don't have to specify any options, just {} should do it.
  2. Then add hardcore/ts-for-js to the overrides section in your .eslintrc like this:
{
  "extends": ["hardcore"],

  "env": {
    "browser": true
  },

  "overrides": [
    {
      "files": ["*.js"],
      "extends": ["hardcore/ts-for-js"],
      "parserOptions": {
        "project": "./tsconfig.json"
      }
    }
  ]
}

Changelog

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].