eslint-config-ts-strict
Version:
Very strict ESLint config for projects using TypeScript, React and Prettier. ESLint v9 flat config only. Formatting rules disabled to prevent Prettier conflicts.
45 lines (36 loc) • 1.31 kB
JavaScript
import confusingBrowserGlobals from "confusing-browser-globals";
export default {
rules: {
// disallow the catch clause parameter name being the same as a variable in the outer scope
"no-catch-shadow": "off",
// disallow deletion of variables
"no-delete-var": "error",
// disallow labels that share a name with a variable
// https://eslint.org/docs/rules/no-label-var
"no-label-var": "error",
// disallow specific globals
"no-restricted-globals": [
"error",
{
name: "isFinite",
message:
"Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite",
},
{
name: "isNaN",
message:
"Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan",
},
].concat(confusingBrowserGlobals),
// disallow shadowing of names such as arguments
"no-shadow-restricted-names": "error",
// disallow use of undeclared variables unless mentioned in a /*global */ block
"no-undef": "error",
// disallow use of undefined when initializing variables
"no-undef-init": "error",
// disallow use of undefined variable
// https://eslint.org/docs/rules/no-undefined
// TODO: enable?
"no-undefined": "off",
},
};