This commit is contained in:
Alex
2023-11-10 20:29:53 -05:00
parent ee3e7e4203
commit 60b1b8fde3
17 changed files with 539 additions and 128 deletions

View File

@ -237,24 +237,10 @@ index 64bbc8d5..b5e9c803 100644
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
index 069596d7..c155e777 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 = {
@@ -539,7 +539,7 @@ module.exports = {
create(context) {
function getIgnoreConfig() {
@ -262,11 +248,8 @@ index fc573366..74bc36f6 100644
+ 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 {
function getRequireDataLowercase() {
@@ -552,7 +552,7 @@ module.exports = {
JSXAttribute(node) {
const ignoreNames = getIgnoreConfig();
const actualName = context.getSourceCode().getText(node.name);
@ -275,7 +258,7 @@ index fc573366..74bc36f6 100644
return;
}
const name = normalizeAttributeCase(actualName);
@@ -546,6 +557,15 @@ module.exports = {
@@ -580,6 +580,15 @@ module.exports = {
const tagName = getTagName(node);