Skip to content

Commit

Permalink
feat: support typescript-eslint 6
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Jul 12, 2023
1 parent 4464168 commit b714064
Show file tree
Hide file tree
Showing 13 changed files with 3,391 additions and 3,766 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.0
18.16.1
783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.3.cjs

This file was deleted.

874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.2.3.cjs
yarnPath: .yarn/releases/yarn-3.6.1.cjs
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ yarn add @typescript-eslint/parser @typescript-eslint/eslint-plugin typescript -
```js
module.exports = {
extends: ['algolia', 'algolia/typescript']

parserOptions: {
project: '<path-to-tsconfig.json>',
},
};
```

Expand All @@ -186,6 +190,8 @@ module.exports = {
}
```

You also need to make sure that all the files you want to lint are also included in `tsconfig.json` with the `include` property.

### TypeScript with React

**terminal**
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
]
},
"devDependencies": {
"conventional-changelog-cli": "2.2.2",
"doctoc": "2.2.0",
"conventional-changelog-cli": "3.0.0",
"doctoc": "2.2.1",
"json": "11.0.0",
"renovate-config-algolia": "2.1.10"
},
"workspaces": [
"packages/*"
],
"packageManager": "yarn@3.2.3"
"packageManager": "yarn@3.6.1"
}
2 changes: 1 addition & 1 deletion packages/eslint-config-algolia/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
node: true,
},
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 'latest',
sourceType: 'module',
experimentalObjectRestSpread: true,
ecmaFeatures: {
Expand Down
22 changes: 11 additions & 11 deletions packages/eslint-config-algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
},
"homepage": "https://github.com/algolia/eslint-config-algolia",
"devDependencies": {
"@babel/core": "7.18.13",
"@babel/eslint-parser": "7.18.9",
"eslint": "8.3.0",
"eslint-config-prettier": "8.5.0",
"@babel/core": "7.22.8",
"@babel/eslint-parser": "7.22.7",
"eslint": "8.44.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jest": "26.8.7",
"eslint-plugin-jsdoc": "43.1.1",
"eslint-plugin-jsx-a11y": "6.6.1",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.31.1",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jest": "27.2.2",
"eslint-plugin-jsdoc": "46.4.3",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react-hooks": "4.6.0",
"prettier": "2.7.1"
"prettier": "3.0.0"
},
"peerDependencies": {
"eslint": "^5.16.0 || ^6.8.0 || ^7.2.0 || ^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-algolia/rules/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ module.exports = {
'@typescript-eslint/prefer-namespace-keyword': ['error'],
'@typescript-eslint/prefer-optional-chain': ['error'],
'@typescript-eslint/prefer-ts-expect-error': ['error'],
'@typescript-eslint/sort-type-union-intersection-members': ['error'],
'@typescript-eslint/sort-type-constituents': ['error'],
'@typescript-eslint/type-annotation-spacing': ['error'],
'@typescript-eslint/unified-signatures': ['error'],
'@typescript-eslint/no-redeclare': ['error'],
Expand Down
4 changes: 4 additions & 0 deletions packages/test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// eslint-disable-next-line import/no-commonjs
module.exports = {
extends: ['algolia', 'algolia/react', 'algolia/typescript', 'algolia/jest'],

parserOptions: {
project: 'tsconfig.json',
},
};
16 changes: 8 additions & 8 deletions packages/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"author": "Algolia <support@algolia.com> (https://github.com/algolia/)",
"license": "MIT",
"devDependencies": {
"@types/react": "17.0.37",
"@typescript-eslint/eslint-plugin": "5.5.0",
"@typescript-eslint/parser": "5.5.0",
"eslint": "8.3.0",
"eslint-config-algolia": "21.0.0",
"jest": "27.4.2",
"prop-types": "15.7.2",
"@types/react": "17.0.62",
"@typescript-eslint/eslint-plugin": "6.0.0",
"@typescript-eslint/parser": "6.0.0",
"eslint": "8.44.0",
"eslint-config-algolia": "link:../eslint-config-algolia",
"jest": "29.6.1",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-addons-shallow-compare": "15.6.3",
"typescript": "4.5.2"
"typescript": "5.1.6"
}
}
10 changes: 7 additions & 3 deletions packages/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"target": "esnext",
"moduleResolution": "node",
"rootDir": "./src",
"baseUrl": "./",
Expand All @@ -30,7 +30,6 @@
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitUseStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"preserveConstEnums": true,
Expand All @@ -42,5 +41,10 @@
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
}
},
"include": [
"index.js",
"src/*",
".eslintrc.js"
],
}
Loading

0 comments on commit b714064

Please sign in to comment.