* Add local ESLint configuration and disable rules to allow for errorless state * Remove unnecessary ESLint disable comments in AuthContext and usePromptInputStorage for cleaner code. * Update eslint-plugin-react-hooks * Configure prettier to work with eslint * Removed trailing commas from eslint config * Prettier to source code * add a v2 lint script * put back eslint-disable comments * fix eslinter and prettier application always apply --fix since we --write prettier, otherwise it fails * precaution dev build --------- Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
import js from "@eslint/js"
|
|
import globals from "globals"
|
|
import pluginReact from "eslint-plugin-react"
|
|
import pluginReactHooks from "eslint-plugin-react-hooks"
|
|
import pluginPrettier from "eslint-plugin-prettier"
|
|
import configPrettier from "eslint-config-prettier"
|
|
import { defineConfig } from "eslint/config"
|
|
|
|
export default defineConfig([
|
|
{
|
|
ignores: ["**/*.min.js", "src/media/**/*"]
|
|
},
|
|
{
|
|
files: ["src/**/*.{js,jsx}"],
|
|
plugins: { js },
|
|
extends: ["js/recommended"],
|
|
languageOptions: { globals: globals.browser }
|
|
},
|
|
{
|
|
files: ["src/**/*.{js,jsx}"],
|
|
...pluginReact.configs.flat.recommended,
|
|
plugins: {
|
|
"react-hooks": pluginReactHooks,
|
|
prettier: pluginPrettier
|
|
},
|
|
settings: {
|
|
react: {
|
|
version: "detect"
|
|
}
|
|
},
|
|
rules: {
|
|
...configPrettier.rules,
|
|
"prettier/prettier": "error",
|
|
"react/react-in-jsx-scope": "off",
|
|
"react-hooks/exhaustive-deps": "off",
|
|
"no-extra-boolean-cast": "off",
|
|
"no-prototype-builtins": "off",
|
|
"no-unused-vars": "off",
|
|
"no-empty": "off",
|
|
"no-useless-escape": "off",
|
|
"no-undef": "off",
|
|
"no-unsafe-optional-chaining": "off",
|
|
"no-constant-binary-expression": "off"
|
|
}
|
|
}
|
|
])
|