mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Ban the null literal via ESLint and replace existing usages with undefined or truthiness checks (#4401)
This commit is contained in:
@@ -73,6 +73,13 @@ export default defineConfig([
|
||||
],
|
||||
},
|
||||
],
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
{
|
||||
selector: "Literal[raw='null']",
|
||||
message: "Use `undefined` instead of `null`.",
|
||||
},
|
||||
],
|
||||
|
||||
// TypeScript plugin config (for TS-specific linting)
|
||||
"@typescript-eslint/indent": "off",
|
||||
@@ -96,7 +103,7 @@ export default defineConfig([
|
||||
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }],
|
||||
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
|
||||
"@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
|
||||
"@typescript-eslint/no-restricted-types": ["error", { types: { null: "Use `undefined` instead." } }],
|
||||
"@typescript-eslint/no-restricted-types": ["error", { types: { null: "Use `undefined` instead of `null`." } }],
|
||||
|
||||
// Prettier plugin config (for validating and fixing formatting)
|
||||
"prettier/prettier": "error",
|
||||
|
||||
Reference in New Issue
Block a user