Skip to content

Commit

Permalink
Update ESLint to v9 (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtbandes authored Oct 28, 2024
1 parent 8448476 commit 29a9341
Show file tree
Hide file tree
Showing 6 changed files with 668 additions and 758 deletions.
24 changes: 0 additions & 24 deletions .eslintrc.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"eslint.options": {
"reportUnusedDisableDirectives": true
},
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
Expand Down
1 change: 1 addition & 0 deletions bench/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function generateCrc32TableBranchless(polynomial: number) {

function crcUpdateNaive(prev: number, polynomial: number, data: Uint8Array): number {
let r = prev;
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < data.length; i++) {
r ^= data[i]!;
r = ((r & 1) * polynomial) ^ (r >>> 1);
Expand Down
38 changes: 38 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// @ts-check

const foxglove = require("@foxglove/eslint-plugin");
const globals = require("globals");
const tseslint = require("typescript-eslint");

module.exports = tseslint.config(
{
ignores: ["**/dist/"],
},
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
parserOptions: {
project: "tsconfig.eslint.json",
},
},
rules: {
"no-restricted-syntax": [
"error",
{
selector: 'BinaryExpression[operator=">>"]',
message:
"When working with unsigned numbers, use the unsigned right shift operator `>>>`.",
},
],
},
},
...foxglove.configs.base,
...foxglove.configs.jest,
...foxglove.configs.typescript.map((config) => ({
...config,
files: ["**/*.@(ts|tsx)"],
})),
);
24 changes: 9 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,30 @@
"clean": "rimraf dist *.tsbuildinfo",
"prepack": "tsc -b tsconfig.json tsconfig.cjs.json",
"build": "tsc -b tsconfig.json tsconfig.cjs.json",
"lint": "eslint --report-unused-disable-directives --fix .",
"lint:ci": "eslint --report-unused-disable-directives .",
"lint": "eslint --fix .",
"lint:ci": "eslint .",
"bench": "ts-node --project tsconfig.cjs.json bench/index.ts",
"test": "jest"
},
"dependencies": {},
"devDependencies": {
"@foxglove/eslint-plugin": "0.22.1",
"@foxglove/eslint-plugin": "2.0.0",
"@foxglove/tsconfig": "2.0.0",
"@types/crc": "3.8.3",
"@types/jest": "29.5.12",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"@types/node": "22.7.9",
"benny": "3.7.1",
"crc": "4.3.2",
"crc-32": "1.2.2",
"eslint": "8.57.1",
"eslint-config-prettier": "8.10.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-jest": "28.8.3",
"eslint-plugin-prettier": "4.2.1",
"eslint": "9.13.0",
"globals": "15.11.0",
"jest": "29.7.0",
"node-crc": "3.0.2",
"polycrc": "1.1.1",
"prettier": "2.8.8",
"prettier": "3.3.3",
"rimraf": "6.0.1",
"ts-jest": "29.2.5",
"ts-node": "10.9.2",
"typescript": "5.6.3"
"typescript": "5.6.3",
"typescript-eslint": "8.10.0"
}
}
Loading

0 comments on commit 29a9341

Please sign in to comment.