Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"postinstall": "rm -rf node_modules/markdownlint-cli/node_modules/markdownlint",
"install:config": "cd packages/eslint-config-airbnb && npm prune && npm install",
"install:config:base": "cd packages/eslint-config-airbnb-base && npm prune && npm install",
"lint": "markdownlint --config linters/.markdownlint.json README.md */README.md",
"lint": "markdownlint --config linters/.markdownlint.json README.md */README.md && eslint -c linters/.eslintrc . --ext .js --ext .jsx --ext .mjs",
"pretest": "npm run --silent lint",
"test": "npm run --silent test:config && npm run --silent test:config:base",
"test:config": "cd packages/eslint-config-airbnb; npm test",
Expand Down Expand Up @@ -40,6 +40,7 @@
},
"homepage": "https://github.com/airbnb/javascript",
"devDependencies": {
"eslint": "^8.57.1",
"markdownlint": "^0.29.0",
"markdownlint-cli": "^0.35.0"
}
Expand Down
10 changes: 10 additions & 0 deletions packages/eslint-config-airbnb-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ Our default export contains all of our ESLint rules, including ECMAScript 6+. It

2. Add `"extends": "airbnb-base"` to your .eslintrc.

> **Note**: ESLint only lints `.js` files by default.

If your project uses `.jsx` (or `.tsx` with TypeScript), you need to pass extensions to the CLI:

```sh
eslint . --ext .js, .jsx, .mjs
```

Without this, JSX-related rules will not apply to `.jsx` files.

### eslint-config-airbnb-base/legacy

Lints ES5 and below. Requires `eslint` and `eslint-plugin-import`.
Expand Down
9 changes: 9 additions & 0 deletions packages/eslint-config-airbnb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ If you don't need React, see [eslint-config-airbnb-base](https://npmjs.com/eslin

2. Add `"extends": "airbnb"` to your `.eslintrc`

> **Note**: ESLint only lints `.js` files by default.
If your project uses `.jsx` (or `.tsx` with TypeScript), you need to pass extensions to the CLI:

```sh
eslint . --ext .js, .jsx, .mjs
```

Without this, JSX-related rules will not apply to `.jsx` files.

### eslint-config-airbnb/hooks

This entry point enables the linting rules for React hooks (requires v16.8+). To use, add `"extends": ["airbnb", "airbnb/hooks"]` to your `.eslintrc`.
Expand Down