modify eslint and tsconfig files to be nonbreaking
Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
+2
-2
@@ -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)",
|
||||
},
|
||||
|
||||
@@ -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)",
|
||||
},
|
||||
|
||||
@@ -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
@@ -11,6 +11,7 @@
|
||||
"compilerOptions": {
|
||||
"outDir": "dist-types",
|
||||
"rootDir": ".",
|
||||
"useUnknownInCatchVariables": false
|
||||
"useUnknownInCatchVariables": false,
|
||||
"jsx": "react-jsx"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user