Skip to content

Commit

Permalink
eslint update
Browse files Browse the repository at this point in the history
  • Loading branch information
obra committed Nov 26, 2024
1 parent fbe41e8 commit 795b98c
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 64 deletions.
62 changes: 0 additions & 62 deletions .eslintrc.js

This file was deleted.

64 changes: 64 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import js from "@eslint/js";
import globals from "globals";
import babelParser from "@babel/eslint-parser";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
import importPlugin from "eslint-plugin-import";
import prettierPlugin from "eslint-plugin-prettier";
import editorConfigPlugin from "eslint-plugin-editorconfig";

export default [
js.configs.recommended,
{
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: {
react: reactPlugin,
"react-hooks": reactHooksPlugin,
"jsx-a11y": jsxA11yPlugin,
import: importPlugin,
prettier: prettierPlugin,
editorconfig: editorConfigPlugin,
},
languageOptions: {
parser: babelParser,
ecmaVersion: 2017,
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
MAIN_WINDOW_WEBPACK_ENTRY: true,
MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: true,
},
},
settings: {
"import/resolver": {
node: {
paths: ["src"],
extensions: [".js", ".jsx", ".ts", ".d.ts", ".tsx"],
},
webpack: { config: "./config/webpack.dev.js" },
},
react: {
pragma: "React",
version: "detect",
},
propWrapperFunctions: [
"forbidExtraProps",
{ property: "freeze", object: "Object" },
{ property: "myFavoriteWrapper" },
],
linkComponents: ["Hyperlink", { name: "Link", linkAttribute: "to" }],
},
rules: {
"no-console": 0,
"react/prop-types": 0,
"no-unused-vars": 0, // disabled due to false positives
"no-async-promise-executor": 0, // grandfathered in during eslint update
"no-prototype-builtins": 0, // grandfathered in during eslint update
"prefer-const": "error",
"react-hooks/rules-of-hooks": "error",
"prettier/prettier": "error",
},
},
];
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.18.6",
"@babel/runtime": "^7.22.6",
"@eslint/js": "^9.15.0",
"@types/react": "^18",
"babel-loader": "^9.1.2",
"cldr": "^7.1.1",
Expand All @@ -61,6 +62,7 @@
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.4.0",
"gh-pages": "^6.2.0",
"globals": "^15.12.0",
"http-server": "^14.1.1",
"mini-css-extract-plugin": "^2.7.6",
"npm-run-all": "^4.1.3",
Expand Down
1 change: 0 additions & 1 deletion src/api/focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ class Focus {
const decoder = new TextDecoder();
const reader = this._port.readable.getReader();
try {
// eslint-disable-next-line no-constant-condition
while (true) {
const { value, done } = await reader.read();
if (value) {
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.56.0.tgz#ef20350fec605a7f7035a01764731b2de0f3782b"
integrity sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==

"@eslint/[email protected]":
"@eslint/[email protected]", "@eslint/js@^9.15.0":
version "9.15.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.15.0.tgz#df0e24fe869143b59731942128c19938fdbadfb5"
integrity sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==
Expand Down Expand Up @@ -4451,6 +4451,11 @@ globals@^14.0.0:
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==

globals@^15.12.0:
version "15.12.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-15.12.0.tgz#1811872883ad8f41055b61457a130221297de5b5"
integrity sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==

globalthis@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf"
Expand Down

0 comments on commit 795b98c

Please sign in to comment.