![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@wang1212/eslint-config
Advanced tools
Community-recommended best practices for [ESLint](https://eslint.org/) rule configuration.(Use with [Prettier](https://prettier.io/))
English | 简体中文
🔧 This package provides community-recommended ESLint rules configuration as an extensible shared configuration. (Use with Prettier)
Support ESLint V8, Node.js requires version >=12.22.0.
npm install --save-dev @wang1212/eslint-config
Install peerDependencies
:
npm install --save-dev eslint
npm install --save-dev --save-exact prettier
Create a .prettierrc.yml file in the project root directory and configure the following:
# see docs: https://prettier.io/docs/en/configuration.html
# prettier config
printWidth: 80
tabWidth: 2
useTabs: false
singleQuote: true
semi: true
endOfLine: 'auto'
This is just a recommended configuration and can be adjusted to your liking.
Then you need to add @wang1212/eslint-config
in your .eslintrc.json:
{
+ "extends": ["@wang1212/eslint-config"]
}
The rule configuration of ESLint can be configured and covered according to your own requirements, please refer to the official documentation.
@wang1212/eslint-config
This configuration is for basic JavaScript, based on the Airbnb JavaScript Style Guide, SonarJS, JSDoc, and check API compatibility with Browserslist. (See Source)
@wang1212/eslint-config/typescript
This configuration is for basic TypeScript, based on the Airbnb JavaScript Style Guide, SonarJS, TSDoc, and check API compatibility with Browserslist. (See Source)
This config also has an alias @wang1212/eslint-config/ts
.
Using this configuration also requires some extra work.
Install additional peerDependencies
:
npm install --save-dev @typescript-eslint/parser
Then you need to add @wang1212/eslint-config/typescript
in your .eslintrc.json:
{
- "extends": ["@wang1212/eslint-config"],
+ "extends": ["@wang1212/eslint-config/typescript"],
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": {
+ "project": './tsconfig.json'
+ },
}
@wang1212/eslint-config/react
This configuration is for react.js applications written in JavaScript, based on the Airbnb JavaScript Style Guide, Hooks, SonarJS, JSDoc, and check API compatibility with Browserslist. (See Source)
Using this configuration also requires some extra work.
You need to add @wang1212/eslint-config/react
in your .eslintrc.json:
{
- "extends": ["@wang1212/eslint-config"],
+ "extends": ["@wang1212/eslint-config/react"],
}
@wang1212/eslint-config/react-typescript
This configuration is for react.js applications written in TypeScript, based on the Airbnb JavaScript Style Guide, Hooks, SonarJS, TSDoc, and check API compatibility with Browserslist. (See Source)
This config also has an alias @wang1212/eslint-config/react-ts
.
Using this configuration also requires some extra work.
Install additional peerDependencies
:
npm install --save-dev @typescript-eslint/parser
Then you need to add @wang1212/eslint-config/react-typescript
in your .eslintrc.json:
{
- "extends": ["@wang1212/eslint-config"],
+ "extends": ["@wang1212/eslint-config/react-typescript"],
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": {
+ "project": './tsconfig.json'
+ },
}
@wang1212/eslint-config/node
This configuration is for Node.js programs written in JavaScript, based on the Airbnb JavaScript Style Guide, SonarJS, JSDoc. (See Source)
Using this configuration also requires some extra work.
You need to add @wang1212/eslint-config/node
in your .eslintrc.json:
{
- "extends": ["@wang1212/eslint-config"],
+ "extends": ["@wang1212/eslint-config/node"],
}
Adopt community commit format best practices:
# Before
git commit
# Now
npm run commit
This constraint relies on tools commitizen and commitlint provided by the community.
The version management of this module adopts the specifications recommended by the community Semantic Versioning. Follow version changes and maintain a CHANGELOG.md(Learn why).
# Update version and generate changelog before publishing to npm repository
npm run release # npm run release -- --first-release
# Or, preview
npm run release -- --dry-run
# Then
npm publish # npm publish --access public
These jobs are done with the help of standard-version tool provided by the community.
MIT.
FAQs
Community-recommended best practices for [ESLint](https://eslint.org/) rule configuration.(Use with [Prettier](https://prettier.io/))
The npm package @wang1212/eslint-config receives a total of 4 weekly downloads. As such, @wang1212/eslint-config popularity was classified as not popular.
We found that @wang1212/eslint-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.