Skip to content

Commit

Permalink
Merge pull request #1137 from wantedly/chloe463/build/eslint-v9
Browse files Browse the repository at this point in the history
feat: Support ESLint v9
  • Loading branch information
chloe463 authored Sep 25, 2024
2 parents d8ec230 + ee89e1f commit 3d1ed59
Show file tree
Hide file tree
Showing 70 changed files with 11,143 additions and 5,132 deletions.
9 changes: 9 additions & 0 deletions .changeset/five-masks-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"eslint-config-wantedly-typescript": major
"eslint-plugin-use-macros": major
"eslint-config-wantedly": major
"eslint-plugin-wantedly": major
"frolint": major
---

Support ESLint v9
19 changes: 0 additions & 19 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/[email protected]
Expand Down
35 changes: 35 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { base as eslintConfigWantedly } from "eslint-config-wantedly";
import { base as eslintConfigWantedlyTs } from "eslint-config-wantedly-typescript";

/** @type{import('eslint').Linter.Config[]} */
export default [
...eslintConfigWantedly,
...eslintConfigWantedlyTs,
{
ignores: ["packages/**/lib/*.js"],
},
{
files: ["**/*.ts", "**/*.tsx"],
rules: {
"no-console": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
disallowTypeAnnotations: true,
},
],
"import/order": [
"error",
{
"newlines-between": "always",
groups: ["builtin", "external", "parent", "sibling", "index"],
alphabetize: {
order: "asc",
},
},
],
},
},
];
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@types/eslint": "^8.44.8",
"@types/estree": "^1.0.5",
"@types/estree": "^1.0.6",
"@types/graphql": "^14.5.0",
"@types/jest": "^27.4.0",
"jest": "^29.7.0",
Expand Down
36 changes: 36 additions & 0 deletions packages/eslint-config-wantedly-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

ESLint config for Wantedly. It focuses the TypeScript linting.

## Version Compatibilities

If you're using ESLint v8 and under, please use eslint-config-wantedly-typescript version 3.x. As of eslint-config-wantedly-typescript version 4.0, it has started exporting ESLint's flat config format.

### Usage (version 4.0 and above)

It exports configurations as "Flat config".

```js
import { base as configWantedlyTS } from "eslint-config-wantedly-typescript";

export default [
...configWantedlyTS,
{
rules: {
// Your rules go here.
}
}
];
```

### Usage (version 3.x and under)

It exports configurations as "Legacy" format.

```json
{
"extends": ["wantedly-typescript"],
"rules": {
// Your rules go here.
}
}
```

## Configuration details

### Parser

Using `@typescript-eslint/parser`
Expand Down
Loading

0 comments on commit 3d1ed59

Please sign in to comment.