Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Electron React Boilerplate | 22,098 | 5 | 6 days ago | 3 | April 28, 2016 | 106 | mit | TypeScript | ||
A Foundation for Scalable Cross-Platform Apps | ||||||||||
Js Stack From Scratch | 19,396 | 2 | a year ago | 1 | January 19, 2017 | 48 | mit | JavaScript | ||
🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack. | ||||||||||
Front End Guide | 14,903 | 2 | 6 months ago | 1 | June 22, 2017 | 25 | mit | JavaScript | ||
📚 Study guide and introduction to the modern front end stack. | ||||||||||
Eslint Plugin React | 8,701 | 301,776 | 112,651 | 5 days ago | 200 | August 16, 2023 | 287 | mit | JavaScript | |
React-specific linting rules for ESLint | ||||||||||
Eslint Config Prettier | 4,985 | 46,197 | 131,915 | 5 days ago | 71 | August 05, 2023 | 2 | mit | JavaScript | |
Turns off all rules that are unnecessary or might conflict with Prettier. | ||||||||||
Next Enterprise | 4,725 | 2 days ago | 2 | mit | TypeScript | |||||
💼 An enterprise-grade Next.js boilerplate for high-performance, maintainable apps. Packed with features like Tailwind CSS, TypeScript, ESLint, Prettier, testing tools, and more to accelerate your development. | ||||||||||
Awesome Eslint | 3,911 | 9 days ago | 1 | cc0-1.0 | ||||||
A list of awesome ESLint plugins, configs, etc. | ||||||||||
Eslint Plugin Jsx A11y | 3,247 | 213,794 | 58,534 | 5 days ago | 81 | November 01, 2023 | 99 | mit | JavaScript | |
Static AST checker for a11y rules on JSX elements. | ||||||||||
Eslint Config Alloy | 2,582 | 190 | 725 | 3 months ago | 57 | August 28, 2023 | 2 | JavaScript | ||
Progressive ESLint config for your React/Vue/TypeScript projects | ||||||||||
Ts Nextjs Tailwind Starter | 2,342 | 23 days ago | 5 | TypeScript | ||||||
🔋 Next.js + Tailwind CSS + TypeScript starter and boilerplate packed with useful development features |
English / 简体中文
NEWS: eslint-config-alloy now support TypeScript 5.0
If you are using TypeScript 4.0, please npm install --save-dev eslint-config-alloy@4
NEWS: eslint-config-alloy now support Vue 3.0
If you are using Vue 2.0, please npm install --save-dev eslint-config-alloy@3
The AlloyTeam ESLint config is not only a progressive ESLint config for your React/Vue/TypeScript projects but also the best reference for configuring your personalized ESLint rules.
Please choose the following configuration based on the technology stack used by your project:
Prettier is a code formatting tool that offers fewer options but is more professional than the style-related rules in ESLint.
Now that Prettier has become a necessary tool in front-end projects, eslint-config-alloy does not need to maintain the style-related rules in ESLint anymore, so we completely removed all Prettier related rules in the v3 version, and use ESLint to check logical errors which it's good at.
As for whether two spaces or four spaces are used for indentation and whether there is a semicolon at the end, you can configure it in the project's .prettierrc.js
. Of course, we also provide a recommended Prettier configuration for your reference.
Don't you remember how ESLint defeated JSHint and became the most popular JS code inspection tool? It is because of the plugin and configuration that ESLint advocates, which meets the individual needs of different technology stacks of different teams.
Therefore, eslint-config-alloy also inherits the philosophy of ESLint. It will not emphasize the need to use our config. Instead, we help you to make your config by reference our completed documents, examples, tests, websites, etc.
Relentless push automation
eslint-config-alloy
uses a high degree of automation to hand over all processes that can be managed automatically, including:
Also, through automated scripts, we can even divide and conquer thousands of ESLint configuration files, and each rule is managed in a separate directory:
bad.js
andgood.js
in a single configuration are output to website by script, and you can even see the error message (which are run in a real ESLint script) in the bad.js
of website
The benefits of this are very obvious — test as a document, as a website. We can maintain the rules and tests in one place. Other tasks are handed over to an automated script, which greatly reduces the maintenance cost. In short, when we have a new rule to add, we only need to write three files test/index/another-rule/.eslintrc.js
, test/index/another-rule/bad.js
, test/index/another-rule/good.js
.
ESLint is updated very quickly, there is a new version almost every week, sometimes there are new rules, sometimes existing rules are deprecated, and related plug-ins (React/Vue/TypeScript) will be updated from time to time. Without automation tools, it is difficult to follow up.
And eslint-config-alloy
, through the above-mentioned automated tools, can receive notifications from GitHub Actions at the first time, telling us which rules need to be added:
In this way, we can follow the latest rules in a time when the front-end community is changing rapidly, and always keep the vitality and advanced of eslint-config-alloy
.
npm install --save-dev eslint @babel/core @babel/eslint-parser eslint-config-alloy
Create an .eslintrc.js
in the root directory of your project, then copy the following content into it:
module.exports = {
extends: [
'alloy',
],
env: {
// Your environments (which contains several predefined global variables)
//
// browser: true,
// node: true,
// mocha: true,
// jest: true,
// jquery: true
},
globals: {
// Your global variables (setting to false means it's not allowed to be reassigned)
//
// myGlobal: false
},
rules: {
// Customize your rules
},
};
npm install --save-dev eslint @babel/core @babel/eslint-parser @babel/preset-react@latest eslint-plugin-react eslint-config-alloy
Create an .eslintrc.js
in the root directory of your project, then copy the following content into it:
module.exports = {
extends: [
'alloy',
'alloy/react',
],
env: {
// Your environments (which contains several predefined global variables)
//
// browser: true,
// node: true,
// mocha: true,
// jest: true,
// jquery: true
},
globals: {
// Your global variables (setting to false means it's not allowed to be reassigned)
//
// myGlobal: false
},
rules: {
// Customize your rules
},
};
npm install --save-dev eslint @babel/core @babel/eslint-parser vue-eslint-parser eslint-plugin-vue eslint-config-alloy
Create an .eslintrc.js
in the root directory of your project, then copy the following content into it:
module.exports = {
extends: [
'alloy',
'alloy/vue',
],
env: {
// Your environments (which contains several predefined global variables)
//
// browser: true,
// node: true,
// mocha: true,
// jest: true,
// jquery: true
},
globals: {
// Your global variables (setting to false means it's not allowed to be reassigned)
//
// myGlobal: false
},
rules: {
// Customize your rules
},
};
npm install --save-dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-alloy
Create an .eslintrc.js
in the root directory of your project, then copy the following content into it:
module.exports = {
extends: [
'alloy',
'alloy/typescript',
],
env: {
// Your environments (which contains several predefined global variables)
//
// browser: true,
// node: true,
// mocha: true,
// jest: true,
// jquery: true
},
globals: {
// Your global variables (setting to false means it's not allowed to be reassigned)
//
// myGlobal: false
},
rules: {
// Customize your rules
},
};
npm install --save-dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react eslint-config-alloy
Create an .eslintrc.js
in the root directory of your project, then copy the following content into it:
module.exports = {
extends: [
'alloy',
'alloy/react',
'alloy/typescript',
],
env: {
// Your environments (which contains several predefined global variables)
//
// browser: true,
// node: true,
// mocha: true,
// jest: true,
// jquery: true
},
globals: {
// Your global variables (setting to false means it's not allowed to be reassigned)
//
// myGlobal: false
},
rules: {
// Customize your rules
},
};
It is recommended to use npm init vue@3
to create a project with Vue, TypeScript and ESLint integrated, and then refer to this example to adjust its ESLint configuration.
The conventional way is as follows:
npm install --save-dev @babel/core @babel/eslint-parser @typescript-eslint/eslint-plugin @typescript-eslint/parser @vue/eslint-config-typescript eslint eslint-config-alloy eslint-plugin-vue vue-eslint-parser
Create an .eslintrc.js
in the root directory of your project, then copy the following content into it:
module.exports = {
extends: ['alloy', 'alloy/vue', 'alloy/typescript'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: {
js: '@babel/eslint-parser',
jsx: '@babel/eslint-parser',
ts: '@typescript-eslint/parser',
tsx: '@typescript-eslint/parser',
// Leave the template parser unspecified, so that it could be determined by `<script lang="...">`
},
},
env: {
// Your environments (which contains several predefined global variables)
//
// browser: true,
// node: true,
// mocha: true,
// jest: true,
// jquery: true
},
globals: {
// Your global variables (setting to false means it's not allowed to be reassigned)
//
// myGlobal: false
},
rules: {
// Customize your rules
},
};
Just install the ESLint extension in VSCode.
Refer to here to configure the extension.
If you want to enable auto-fix-on-save, you need to set your .vscode/settings.json
like this:
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
}
eslint-config-alloy
does not include any style-related rules in v3, so there is no need to install eslint-config-prettier
. Just install prettier
and related VSCode plugins.
AlloyTeam provides a set of Prettier configuration, you can create a .prettierrc
to reuse it:
"eslint-config-alloy/.prettierrc.js"
A best practice for VSCode is to auto format code with Prettier and autofix errors with ESLint by setting .vscode/settings.json
to this:
{
"files.eol": "\n",
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
# install dependencies
pnpm i
# build eslintrc like index.js, react.js, etc.
pnpm build
# run tests
pnpm test
# autofix prettier errors
pnpm prettier:fix
# check if all rules are covered
pnpm rulesCoverage
# publish new version
npm version <major|minor|patch>
git push --follow-tags
npm publish
Our team initially used Airbnb rules, but because it was too strict, some rules still needed to be personalized, which led to more and more changes in the future and finally decided to maintain a new set. After more than four years of maintaining, eslint-config-alloy
is now very mature and progressive and has been welcomed by many teams inside and outside the company.
The standard specification believes that everyone should not waste time in personalized specifications, but the entire community should unify a specification. This statement makes some sense, but it runs against the ESLint's design philosophy. Don't you remember how ESLint defeated JSHint and became the most popular JS code inspection tool? It is because of the plugin and configuration that ESLint advocates, which meets the individual needs of different technology stacks of different teams.
Therefore, eslint-config-alloy
also inherits the philosophy of ESLint. It will not force you to use our config. Instead, we help you to make your config by referencing our examples, tests, websites and so on.
airbnb
eslint-config-alloy
has officially maintained vue
, typescript
and react+typescript
rules. In contrast, airbnb's vue
and typescript
are maintained by third parties.airbnb
It's okay, eslint-config-alloy
believes that different teams and projects can have different configurations from the design concept. Although you choose to use airbnb
, you can still come to our website when you have personalized configuration needs.