diff --git a/.eslintrc.json b/.eslintrc.json --- a/.eslintrc.json +++ b/.eslintrc.json @@ -14,7 +14,14 @@ "prettier" ], "parser": "@babel/eslint-parser", - "plugins": ["react", "react-hooks", "flowtype", "monorepo", "import"], + "plugins": [ + "react", + "react-hooks", + "flowtype", + "monorepo", + "import", + "@stylistic/js" + ], "rules": { // Prettier is configured to keep lines to 80 chars, but there are two issues: // - It doesn't handle comments (leaves them as-is) @@ -22,12 +29,13 @@ // We want ESLint to warn us in the first case, but not in the second case // since Prettier forces us in the second case. By setting code to 5000, we // make sure ESLint defers to Prettier for import statements. - "max-len": ["error", { "code": 5000, "comments": 80, "ignoreUrls": true }], + "@stylistic/js/max-len": [ + "error", + { "code": 5000, "comments": 80, "ignoreUrls": true } + ], "flowtype/require-valid-file-annotation": ["error", "always"], "flowtype/require-exact-type": ["error", "never"], "curly": "error", - "linebreak-style": "error", - "semi": "error", "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn", "monorepo/no-relative-import": "error", diff --git a/package.json b/package.json --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ }, "devDependencies": { "@babel/eslint-parser": "^7.23.3", + "@stylistic/eslint-plugin-js": "^1.5.3", "clang-format": "^1.8.0", "core-js": "^3.6.5", "eslint": "^8.56.0", diff --git a/yarn.lock b/yarn.lock --- a/yarn.lock +++ b/yarn.lock @@ -5346,6 +5346,16 @@ "@stablelib/random" "^1.0.2" "@stablelib/wipe" "^1.0.1" +"@stylistic/eslint-plugin-js@^1.5.3": + version "1.5.3" + resolved "https://registry.yarnpkg.com/@stylistic/eslint-plugin-js/-/eslint-plugin-js-1.5.3.tgz#da7a7576a6ba9feef1f6db12504a5c4ba45a70a1" + integrity sha512-XlKnm82fD7Sw9kQ6FFigE0tobvptNBXZWsdfoKmUyK7bNxHsAHOFT8zJGY3j3MjZ0Fe7rLTu86hX/vOl0bRRdQ== + dependencies: + acorn "^8.11.3" + escape-string-regexp "^4.0.0" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -6978,7 +6988,7 @@ resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.1.0, acorn@^8.8.1, acorn@^8.9.0: +acorn@^8.1.0, acorn@^8.11.3, acorn@^8.8.1, acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==