Update
This commit is contained in:
@ -236,6 +236,61 @@ index 64bbc8d5..b5e9c803 100644
|
||||
const docsUrl = require('../util/docsUrl');
|
||||
const isCreateElement = require('../util/isCreateElement');
|
||||
const report = require('../util/report');
|
||||
diff --git a/lib/rules/no-unknown-property.js b/lib/rules/no-unknown-property.js
|
||||
index fc573366..74bc36f6 100644
|
||||
--- a/lib/rules/no-unknown-property.js
|
||||
+++ b/lib/rules/no-unknown-property.js
|
||||
@@ -516,6 +516,13 @@ module.exports = {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
+ extends: {
|
||||
+ type: 'array',
|
||||
+ items: {
|
||||
+ type: 'string',
|
||||
+ enum: ['next', 'emotion'],
|
||||
+ },
|
||||
+ }
|
||||
},
|
||||
additionalProperties: false,
|
||||
}],
|
||||
@@ -523,14 +530,18 @@ module.exports = {
|
||||
|
||||
create(context) {
|
||||
function getIgnoreConfig() {
|
||||
- return (context.options[0] && context.options[0].ignore) || DEFAULTS.ignore;
|
||||
+ return context.options[0]?.ignore || DEFAULTS.ignore;
|
||||
}
|
||||
|
||||
+ const extensions = /** @type {string[]} */ (context.options[0]?.extends || []);
|
||||
+ const hasEmotion = extensions.includes('emotion');
|
||||
+ const hasNext = extensions.includes('next');
|
||||
+
|
||||
return {
|
||||
JSXAttribute(node) {
|
||||
const ignoreNames = getIgnoreConfig();
|
||||
const actualName = context.getSourceCode().getText(node.name);
|
||||
- if (ignoreNames.indexOf(actualName) >= 0) {
|
||||
+ if (ignoreNames.includes(actualName)) {
|
||||
return;
|
||||
}
|
||||
const name = normalizeAttributeCase(actualName);
|
||||
@@ -546,6 +557,15 @@ module.exports = {
|
||||
|
||||
const tagName = getTagName(node);
|
||||
|
||||
+ if (
|
||||
+ (actualName === 'css' && hasEmotion) ||
|
||||
+ (tagName === 'style' &&
|
||||
+ (actualName === 'global' || actualName === 'jsx') &&
|
||||
+ hasNext)
|
||||
+ ) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (tagName === 'fbt' || tagName === 'fbs') { return; } // fbt/fbs nodes are bonkers, let's not go there
|
||||
|
||||
if (!isValidHTMLTagInJSX(node)) { return; }
|
||||
diff --git a/lib/util/annotations.js b/lib/util/annotations.js
|
||||
index 60aaef8c..ad8dc0bf 100644
|
||||
--- a/lib/util/annotations.js
|
||||
@ -284,10 +339,10 @@ index 55073bfe..efc07af1 100644
|
||||
const astUtil = require('./ast');
|
||||
const isCreateElement = require('./isCreateElement');
|
||||
diff --git a/package.json b/package.json
|
||||
index e37bae08..5bfa4b9f 100644
|
||||
index 702b9f6f..f34d71d3 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -25,21 +25,13 @@
|
||||
@@ -25,22 +25,14 @@
|
||||
"homepage": "https://github.com/jsx-eslint/eslint-plugin-react",
|
||||
"bugs": "https://github.com/jsx-eslint/eslint-plugin-react/issues",
|
||||
"dependencies": {
|
||||
@ -295,6 +350,7 @@ index e37bae08..5bfa4b9f 100644
|
||||
- "array.prototype.flatmap": "^1.3.1",
|
||||
- "array.prototype.tosorted": "^1.1.1",
|
||||
"doctrine": "^2.1.0",
|
||||
"es-iterator-helpers": "^1.0.13",
|
||||
"estraverse": "^5.3.0",
|
||||
"jsx-ast-utils": "^2.4.1 || ^3.0.0",
|
||||
"minimatch": "^3.1.2",
|
||||
@ -309,7 +365,7 @@ index e37bae08..5bfa4b9f 100644
|
||||
+ "semver": "^6.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.22.9",
|
||||
"@babel/core": "^7.22.10",
|
||||
diff --git a/tsconfig.json b/tsconfig.json
|
||||
deleted file mode 100644
|
||||
index 39187b7f..00000000
|
||||
|
Reference in New Issue
Block a user