-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ESLint is migrating to a flat config file. We drop eslint-plugin-import because it does not the flat config file. We can't upgrade to ESLint v9 because eslint-plugin-react does not support ESLint v9 yet.
- Loading branch information
Showing
33 changed files
with
603 additions
and
379 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# Eslint | ||
npx eslint src | ||
|
||
# Prettier | ||
npx prettier --check src | ||
npx eslint *.js *.mjs src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { fixupConfigRules } from "@eslint/compat" | ||
import pluginJs from "@eslint/js" | ||
import pluginJest from "eslint-plugin-jest" | ||
import pluginNode from "eslint-plugin-n" | ||
import pluginPrettierConfigRecommended from "eslint-plugin-prettier/recommended" | ||
import pluginPromise from "eslint-plugin-promise" | ||
import pluginReactJSXRuntime from "eslint-plugin-react/configs/jsx-runtime.js" | ||
import pluginReactConfigRecommended from "eslint-plugin-react/configs/recommended.js" | ||
import pluginSimpleImportSort from "eslint-plugin-simple-import-sort" | ||
import globals from "globals" | ||
|
||
export default [ | ||
pluginJs.configs.recommended, | ||
pluginJest.configs["flat/recommended"], | ||
pluginNode.configs["flat/recommended-module"], | ||
...fixupConfigRules(pluginReactConfigRecommended), | ||
...fixupConfigRules(pluginReactJSXRuntime), | ||
pluginPrettierConfigRecommended, | ||
{ | ||
plugins: { | ||
"simple-import-sort": pluginSimpleImportSort, | ||
promise: pluginPromise, | ||
}, | ||
languageOptions: { | ||
globals: { ...globals.browser, ...globals.node }, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }], | ||
"n/no-unsupported-features/node-builtins": "off", // Don't complain about 'fetch', 'URL.createObjectURL', and 'navigator' | ||
"promise/always-return": "error", | ||
"promise/no-return-wrap": "error", | ||
"promise/param-names": "error", | ||
"promise/catch-or-return": ["error", { allowFinally: true }], | ||
"promise/no-native": "off", | ||
"promise/no-nesting": "warn", | ||
"promise/no-promise-in-callback": "warn", | ||
"promise/no-callback-in-promise": "warn", | ||
"promise/avoid-new": "warn", | ||
"promise/no-new-statics": "error", | ||
"promise/no-return-in-finally": "warn", | ||
"promise/valid-params": "warn", | ||
"simple-import-sort/imports": "error", | ||
"simple-import-sort/exports": "error", | ||
}, | ||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ["**/*.test.js"], | ||
rules: { | ||
"no-import-assign": "off", | ||
"jest/expect-expect": ["error", { assertFunctionNames: ["expect*"] }], | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
const http = require('http'); | ||
const http = require("http") | ||
|
||
const options = { | ||
host: 'localhost', | ||
method: 'GET', | ||
headers: { Connection: "close" }, | ||
host: "localhost", | ||
method: "GET", | ||
path: "/favicon.ico", | ||
port: process.env.FRONTEND_PORT || 5000, | ||
path: '/favicon.ico', | ||
}; | ||
} | ||
|
||
const healthCheck = http.request(options, (response) => { | ||
process.exit(response.statusCode == 200 ? 0 : 1); | ||
}); | ||
process.exitCode = response.statusCode == 200 ? 0 : 1 | ||
}) | ||
|
||
healthCheck.on('error', function() { | ||
process.exit(1); | ||
}); | ||
healthCheck.on("error", function () { | ||
process.exitCode = 1 | ||
}) | ||
|
||
healthCheck.end(); | ||
healthCheck.end() |
Oops, something went wrong.