modify eslint and tsconfig files to be nonbreaking

Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
Paul Schultz
2025-04-07 13:06:10 -05:00
parent b01b0d03dd
commit 5aa0d907ac
5 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -49,13 +49,13 @@ module.exports = {
"CallExpression[arguments.length=0] > MemberExpression[property.name='toUpperCase']",
},
{
message: "Default React import not allowed.",
message: "React default imports are deprecated. Follow the x migration guide for details.",
selector:
"ImportDeclaration[source.value='react'][specifiers.0.type='ImportDefaultSpecifier']",
},
{
message:
"Default React import not allowed. If you need a global type that collides with a React named export (such as `MouseEvent`), try using `globalThis.MouseHandler`.",
"React default imports are deprecated. Follow the x migration guide for details. If you need a global type that collides with a React named export (such as `MouseEvent`), try using `globalThis.MouseHandler`.",
selector:
"ImportDeclaration[source.value='react'] :matches(ImportDefaultSpecifier, ImportNamespaceSpecifier)",
},
+4 -3
View File
@@ -246,15 +246,16 @@ function createConfigForRole(dir, role, extraConfig = {}) {
rules: {
'react/react-in-jsx-scope': 'off',
'no-restricted-syntax': [
'error',
'warn',
{
message: 'Default React import not allowed.',
message:
'React default imports are deprecated. Follow the x migration guide for details.',
selector:
"ImportDeclaration[source.value='react'][specifiers.0.type='ImportDefaultSpecifier']",
},
{
message:
'Default React import not allowed. If you need a global type that collides with a React named export (such as `MouseEvent`), try using `globalThis.MouseHandler`.',
'React default imports are deprecated. Follow the x migration guide for details. If you need a global type that collides with a React named export (such as `MouseEvent`), try using `globalThis.MouseHandler`.',
selector:
"ImportDeclaration[source.value='react'] :matches(ImportDefaultSpecifier, ImportNamespaceSpecifier)",
},
+1 -1
View File
@@ -11,7 +11,7 @@
"importHelpers": false,
"incremental": true,
"isolatedModules": true,
"jsx": "react-jsx",
"jsx": "react",
"lib": ["DOM", "DOM.Iterable", "ScriptHost", "ES2022"],
"module": "ESNext",
"moduleResolution": "node",
@@ -11,6 +11,7 @@
"exclude": ["node_modules"],
"compilerOptions": {
"outDir": "dist-types",
"rootDir": "."
"rootDir": ".",
"jsx": "react-jsx"
}
}
+2 -1
View File
@@ -11,6 +11,7 @@
"compilerOptions": {
"outDir": "dist-types",
"rootDir": ".",
"useUnknownInCatchVariables": false
"useUnknownInCatchVariables": false,
"jsx": "react-jsx"
}
}