This commit is contained in:
Alex 2023-08-21 15:45:59 -04:00
parent 198c731cbb
commit fda7f22872
5 changed files with 214 additions and 153 deletions

10
dist/package.json vendored
View File

@ -1,14 +1,14 @@
{
"name": "@aet/eslint-rules",
"version": "0.0.1-beta.26",
"version": "0.0.1-beta.28",
"license": "UNLICENSED",
"peerDependencies": {
"typescript": "^5.1.6"
},
"dependencies": {
"@types/eslint": "^8.44.2",
"@typescript-eslint/eslint-plugin": "6.3.0",
"@typescript-eslint/parser": "6.3.0",
"@typescript-eslint/eslint-plugin": "6.4.1",
"@typescript-eslint/parser": "6.4.1",
"aria-query": "^5.3.0",
"axe-core": "4.7.2",
"axobject-query": "^3.2.1",
@ -19,12 +19,12 @@
"eslint-config-prettier": "9.0.0",
"eslint-define-config": "^1.23.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-import-resolver-typescript": "^3.6.0",
"eslint-module-utils": "^2.8.0",
"estraverse": "^5.3.0",
"is-core-module": "^2.13.0",
"is-glob": "^4.0.3",
"language-tags": "^1.0.8",
"language-tags": "^1.0.9",
"lodash": "^4.17.21",
"minimatch": "^9.0.3",
"prop-types": "^15.8.1",

View File

@ -14,26 +14,26 @@
"@types/eslint": "^8.44.2",
"@types/estree": "^1.0.1",
"@types/estree-jsx": "^1.0.0",
"@types/lodash": "^4.14.196",
"@types/node": "^20.4.8",
"@typescript-eslint/types": "^6.3.0",
"@types/lodash": "^4.14.197",
"@types/node": "^20.5.1",
"@typescript-eslint/types": "^6.4.1",
"babel-plugin-macros": "^3.1.0",
"dts-bundle-generator": "^8.0.1",
"esbin": "0.0.1-beta.2",
"esbuild": "0.18.20",
"esbin": "0.0.1-beta.3",
"esbuild": "0.19.2",
"esbuild-plugin-alias": "^0.2.1",
"esbuild-register": "3.4.2",
"eslint": "8.46.0",
"eslint": "8.47.0",
"eslint-config-prettier": "9.0.0",
"eslint-define-config": "^1.23.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-unicorn": "^48.0.1",
"glob": "^10.3.3",
"json-schema-to-ts": "^2.9.1",
"json-schema-to-ts": "^2.9.2",
"lodash": "^4.17.21",
"minimatch": "^9.0.3",
"picocolors": "^1.0.0",
"prettier": "^3.0.1",
"prettier": "^3.0.2",
"typescript": "5.1.6"
},
"prettier": {

View File

@ -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

269
pnpm-lock.yaml generated
View File

@ -30,14 +30,14 @@ devDependencies:
specifier: ^1.0.0
version: 1.0.0
'@types/lodash':
specifier: ^4.14.196
version: 4.14.196
specifier: ^4.14.197
version: 4.14.197
'@types/node':
specifier: ^20.4.8
version: 20.4.8
specifier: ^20.5.1
version: 20.5.1
'@typescript-eslint/types':
specifier: ^6.3.0
version: 6.3.0
specifier: ^6.4.1
version: 6.4.1
babel-plugin-macros:
specifier: ^3.1.0
version: 3.1.0
@ -45,38 +45,38 @@ devDependencies:
specifier: ^8.0.1
version: 8.0.1
esbin:
specifier: 0.0.1-beta.2
version: 0.0.1-beta.2(esbuild@0.18.20)
specifier: 0.0.1-beta.3
version: 0.0.1-beta.3(esbuild@0.19.2)
esbuild:
specifier: 0.18.20
version: 0.18.20
specifier: 0.19.2
version: 0.19.2
esbuild-plugin-alias:
specifier: ^0.2.1
version: 0.2.1
esbuild-register:
specifier: 3.4.2
version: 3.4.2(esbuild@0.18.20)
version: 3.4.2(esbuild@0.19.2)
eslint:
specifier: 8.46.0
version: 8.46.0
specifier: 8.47.0
version: 8.47.0
eslint-config-prettier:
specifier: 9.0.0
version: 9.0.0(eslint@8.46.0)
version: 9.0.0(eslint@8.47.0)
eslint-define-config:
specifier: ^1.23.0
version: 1.23.0
eslint-plugin-import:
specifier: ^2.28.0
version: 2.28.0(eslint@8.46.0)
specifier: ^2.28.1
version: 2.28.1(eslint@8.47.0)
eslint-plugin-unicorn:
specifier: ^48.0.1
version: 48.0.1(eslint@8.46.0)
version: 48.0.1(eslint@8.47.0)
glob:
specifier: ^10.3.3
version: 10.3.3
json-schema-to-ts:
specifier: ^2.9.1
version: 2.9.1
specifier: ^2.9.2
version: 2.9.2
lodash:
specifier: ^4.17.21
version: 4.17.21
@ -87,8 +87,8 @@ devDependencies:
specifier: ^1.0.0
version: 1.0.0
prettier:
specifier: ^3.0.1
version: 3.0.1
specifier: ^3.0.2
version: 3.0.2
typescript:
specifier: 5.1.6
version: 5.1.6
@ -1326,8 +1326,8 @@ packages:
to-fast-properties: 2.0.0
dev: true
/@esbuild/android-arm64@0.18.20:
resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==}
/@esbuild/android-arm64@0.19.2:
resolution: {integrity: sha512-lsB65vAbe90I/Qe10OjkmrdxSX4UJDjosDgb8sZUKcg3oefEuW2OT2Vozz8ef7wrJbMcmhvCC+hciF8jY/uAkw==}
engines: {node: '>=12'}
cpu: [arm64]
os: [android]
@ -1335,8 +1335,8 @@ packages:
dev: true
optional: true
/@esbuild/android-arm@0.18.20:
resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==}
/@esbuild/android-arm@0.19.2:
resolution: {integrity: sha512-tM8yLeYVe7pRyAu9VMi/Q7aunpLwD139EY1S99xbQkT4/q2qa6eA4ige/WJQYdJ8GBL1K33pPFhPfPdJ/WzT8Q==}
engines: {node: '>=12'}
cpu: [arm]
os: [android]
@ -1344,8 +1344,8 @@ packages:
dev: true
optional: true
/@esbuild/android-x64@0.18.20:
resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==}
/@esbuild/android-x64@0.19.2:
resolution: {integrity: sha512-qK/TpmHt2M/Hg82WXHRc/W/2SGo/l1thtDHZWqFq7oi24AjZ4O/CpPSu6ZuYKFkEgmZlFoa7CooAyYmuvnaG8w==}
engines: {node: '>=12'}
cpu: [x64]
os: [android]
@ -1353,8 +1353,8 @@ packages:
dev: true
optional: true
/@esbuild/darwin-arm64@0.18.20:
resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==}
/@esbuild/darwin-arm64@0.19.2:
resolution: {integrity: sha512-Ora8JokrvrzEPEpZO18ZYXkH4asCdc1DLdcVy8TGf5eWtPO1Ie4WroEJzwI52ZGtpODy3+m0a2yEX9l+KUn0tA==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
@ -1362,8 +1362,8 @@ packages:
dev: true
optional: true
/@esbuild/darwin-x64@0.18.20:
resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==}
/@esbuild/darwin-x64@0.19.2:
resolution: {integrity: sha512-tP+B5UuIbbFMj2hQaUr6EALlHOIOmlLM2FK7jeFBobPy2ERdohI4Ka6ZFjZ1ZYsrHE/hZimGuU90jusRE0pwDw==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
@ -1371,8 +1371,8 @@ packages:
dev: true
optional: true
/@esbuild/freebsd-arm64@0.18.20:
resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==}
/@esbuild/freebsd-arm64@0.19.2:
resolution: {integrity: sha512-YbPY2kc0acfzL1VPVK6EnAlig4f+l8xmq36OZkU0jzBVHcOTyQDhnKQaLzZudNJQyymd9OqQezeaBgkTGdTGeQ==}
engines: {node: '>=12'}
cpu: [arm64]
os: [freebsd]
@ -1380,8 +1380,8 @@ packages:
dev: true
optional: true
/@esbuild/freebsd-x64@0.18.20:
resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==}
/@esbuild/freebsd-x64@0.19.2:
resolution: {integrity: sha512-nSO5uZT2clM6hosjWHAsS15hLrwCvIWx+b2e3lZ3MwbYSaXwvfO528OF+dLjas1g3bZonciivI8qKR/Hm7IWGw==}
engines: {node: '>=12'}
cpu: [x64]
os: [freebsd]
@ -1389,8 +1389,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-arm64@0.18.20:
resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==}
/@esbuild/linux-arm64@0.19.2:
resolution: {integrity: sha512-ig2P7GeG//zWlU0AggA3pV1h5gdix0MA3wgB+NsnBXViwiGgY77fuN9Wr5uoCrs2YzaYfogXgsWZbm+HGr09xg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
@ -1398,8 +1398,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-arm@0.18.20:
resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==}
/@esbuild/linux-arm@0.19.2:
resolution: {integrity: sha512-Odalh8hICg7SOD7XCj0YLpYCEc+6mkoq63UnExDCiRA2wXEmGlK5JVrW50vZR9Qz4qkvqnHcpH+OFEggO3PgTg==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
@ -1407,8 +1407,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-ia32@0.18.20:
resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==}
/@esbuild/linux-ia32@0.19.2:
resolution: {integrity: sha512-mLfp0ziRPOLSTek0Gd9T5B8AtzKAkoZE70fneiiyPlSnUKKI4lp+mGEnQXcQEHLJAcIYDPSyBvsUbKUG2ri/XQ==}
engines: {node: '>=12'}
cpu: [ia32]
os: [linux]
@ -1416,8 +1416,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-loong64@0.18.20:
resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==}
/@esbuild/linux-loong64@0.19.2:
resolution: {integrity: sha512-hn28+JNDTxxCpnYjdDYVMNTR3SKavyLlCHHkufHV91fkewpIyQchS1d8wSbmXhs1fiYDpNww8KTFlJ1dHsxeSw==}
engines: {node: '>=12'}
cpu: [loong64]
os: [linux]
@ -1425,8 +1425,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-mips64el@0.18.20:
resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==}
/@esbuild/linux-mips64el@0.19.2:
resolution: {integrity: sha512-KbXaC0Sejt7vD2fEgPoIKb6nxkfYW9OmFUK9XQE4//PvGIxNIfPk1NmlHmMg6f25x57rpmEFrn1OotASYIAaTg==}
engines: {node: '>=12'}
cpu: [mips64el]
os: [linux]
@ -1434,8 +1434,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-ppc64@0.18.20:
resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==}
/@esbuild/linux-ppc64@0.19.2:
resolution: {integrity: sha512-dJ0kE8KTqbiHtA3Fc/zn7lCd7pqVr4JcT0JqOnbj4LLzYnp+7h8Qi4yjfq42ZlHfhOCM42rBh0EwHYLL6LEzcw==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [linux]
@ -1443,8 +1443,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-riscv64@0.18.20:
resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==}
/@esbuild/linux-riscv64@0.19.2:
resolution: {integrity: sha512-7Z/jKNFufZ/bbu4INqqCN6DDlrmOTmdw6D0gH+6Y7auok2r02Ur661qPuXidPOJ+FSgbEeQnnAGgsVynfLuOEw==}
engines: {node: '>=12'}
cpu: [riscv64]
os: [linux]
@ -1452,8 +1452,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-s390x@0.18.20:
resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==}
/@esbuild/linux-s390x@0.19.2:
resolution: {integrity: sha512-U+RinR6aXXABFCcAY4gSlv4CL1oOVvSSCdseQmGO66H+XyuQGZIUdhG56SZaDJQcLmrSfRmx5XZOWyCJPRqS7g==}
engines: {node: '>=12'}
cpu: [s390x]
os: [linux]
@ -1461,8 +1461,8 @@ packages:
dev: true
optional: true
/@esbuild/linux-x64@0.18.20:
resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==}
/@esbuild/linux-x64@0.19.2:
resolution: {integrity: sha512-oxzHTEv6VPm3XXNaHPyUTTte+3wGv7qVQtqaZCrgstI16gCuhNOtBXLEBkBREP57YTd68P0VgDgG73jSD8bwXQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
@ -1470,8 +1470,8 @@ packages:
dev: true
optional: true
/@esbuild/netbsd-x64@0.18.20:
resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==}
/@esbuild/netbsd-x64@0.19.2:
resolution: {integrity: sha512-WNa5zZk1XpTTwMDompZmvQLHszDDDN7lYjEHCUmAGB83Bgs20EMs7ICD+oKeT6xt4phV4NDdSi/8OfjPbSbZfQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [netbsd]
@ -1479,8 +1479,8 @@ packages:
dev: true
optional: true
/@esbuild/openbsd-x64@0.18.20:
resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==}
/@esbuild/openbsd-x64@0.19.2:
resolution: {integrity: sha512-S6kI1aT3S++Dedb7vxIuUOb3oAxqxk2Rh5rOXOTYnzN8JzW1VzBd+IqPiSpgitu45042SYD3HCoEyhLKQcDFDw==}
engines: {node: '>=12'}
cpu: [x64]
os: [openbsd]
@ -1488,8 +1488,8 @@ packages:
dev: true
optional: true
/@esbuild/sunos-x64@0.18.20:
resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==}
/@esbuild/sunos-x64@0.19.2:
resolution: {integrity: sha512-VXSSMsmb+Z8LbsQGcBMiM+fYObDNRm8p7tkUDMPG/g4fhFX5DEFmjxIEa3N8Zr96SjsJ1woAhF0DUnS3MF3ARw==}
engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
@ -1497,8 +1497,8 @@ packages:
dev: true
optional: true
/@esbuild/win32-arm64@0.18.20:
resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==}
/@esbuild/win32-arm64@0.19.2:
resolution: {integrity: sha512-5NayUlSAyb5PQYFAU9x3bHdsqB88RC3aM9lKDAz4X1mo/EchMIT1Q+pSeBXNgkfNmRecLXA0O8xP+x8V+g/LKg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
@ -1506,8 +1506,8 @@ packages:
dev: true
optional: true
/@esbuild/win32-ia32@0.18.20:
resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==}
/@esbuild/win32-ia32@0.19.2:
resolution: {integrity: sha512-47gL/ek1v36iN0wL9L4Q2MFdujR0poLZMJwhO2/N3gA89jgHp4MR8DKCmwYtGNksbfJb9JoTtbkoe6sDhg2QTA==}
engines: {node: '>=12'}
cpu: [ia32]
os: [win32]
@ -1515,8 +1515,8 @@ packages:
dev: true
optional: true
/@esbuild/win32-x64@0.18.20:
resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==}
/@esbuild/win32-x64@0.19.2:
resolution: {integrity: sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
@ -1524,14 +1524,14 @@ packages:
dev: true
optional: true
/@eslint-community/eslint-utils@4.4.0(eslint@8.46.0):
/@eslint-community/eslint-utils@4.4.0(eslint@8.47.0):
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
dependencies:
eslint: 8.46.0
eslint-visitor-keys: 3.4.2
eslint: 8.47.0
eslint-visitor-keys: 3.4.3
dev: true
/@eslint-community/regexpp@4.6.2:
@ -1539,8 +1539,8 @@ packages:
engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
dev: true
/@eslint/eslintrc@2.1.1:
resolution: {integrity: sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==}
/@eslint/eslintrc@2.1.2:
resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
ajv: 6.12.6
@ -1556,8 +1556,8 @@ packages:
- supports-color
dev: true
/@eslint/js@8.46.0:
resolution: {integrity: sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==}
/@eslint/js@8.47.0:
resolution: {integrity: sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
@ -1715,12 +1715,12 @@ packages:
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
dev: true
/@types/lodash@4.14.196:
resolution: {integrity: sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==}
/@types/lodash@4.14.197:
resolution: {integrity: sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==}
dev: true
/@types/node@20.4.8:
resolution: {integrity: sha512-0mHckf6D2DiIAzh8fM8f3HQCvMKDpK94YQ0DSVkfWTG9BZleYIWudw9cJxX8oCk9bM+vAkDyujDV6dmKHbvQpg==}
/@types/node@20.5.1:
resolution: {integrity: sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==}
dev: true
/@types/normalize-package-data@2.4.1:
@ -1731,8 +1731,8 @@ packages:
resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==}
dev: true
/@typescript-eslint/types@6.3.0:
resolution: {integrity: sha512-K6TZOvfVyc7MO9j60MkRNWyFSf86IbOatTKGrpTQnzarDZPYPVy0oe3myTMq7VjhfsUAbNUW8I5s+2lZvtx1gg==}
/@typescript-eslint/types@6.4.1:
resolution: {integrity: sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==}
engines: {node: ^16.0.0 || >=18.0.0}
dev: true
@ -2177,14 +2177,14 @@ packages:
is-symbol: 1.0.4
dev: true
/esbin@0.0.1-beta.2(esbuild@0.18.20):
resolution: {integrity: sha512-44c90x+lr9Nu7q4YA0zM0HXLeR+gqn5+9YXEtlFpB/a7NhcN7aVvxczDbwCs3l8KgaHc8lA4XDjnq2FfZIjSPg==}
/esbin@0.0.1-beta.3(esbuild@0.19.2):
resolution: {integrity: sha512-r8elIQs0Q0ArVkZJylVqiXxeNTlwvgjzK5V4lzjGDKbwobSuW2EzHBOmF8/Jb2pSTeysh0oRtXO+3YDne2U/PA==}
hasBin: true
peerDependencies:
esbuild: '>=0.12 <1'
esbuild: '>=0.17 <1'
dependencies:
debug: 4.3.4
esbuild: 0.18.20
esbuild: 0.19.2
pirates: 4.0.6
tsconfig-paths: 4.2.0
transitivePeerDependencies:
@ -2195,45 +2195,45 @@ packages:
resolution: {integrity: sha512-jyfL/pwPqaFXyKnj8lP8iLk6Z0m099uXR45aSN8Av1XD4vhvQutxxPzgA2bTcAwQpa1zCXDcWOlhFgyP3GKqhQ==}
dev: true
/esbuild-register@3.4.2(esbuild@0.18.20):
/esbuild-register@3.4.2(esbuild@0.19.2):
resolution: {integrity: sha512-kG/XyTDyz6+YDuyfB9ZoSIOOmgyFCH+xPRtsCa8W85HLRV5Csp+o3jWVbOSHgSLfyLc5DmP+KFDNwty4mEjC+Q==}
peerDependencies:
esbuild: '>=0.12 <1'
dependencies:
debug: 4.3.4
esbuild: 0.18.20
esbuild: 0.19.2
transitivePeerDependencies:
- supports-color
dev: true
/esbuild@0.18.20:
resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==}
/esbuild@0.19.2:
resolution: {integrity: sha512-G6hPax8UbFakEj3hWO0Vs52LQ8k3lnBhxZWomUJDxfz3rZTLqF5k/FCzuNdLx2RbpBiQQF9H9onlDDH1lZsnjg==}
engines: {node: '>=12'}
hasBin: true
requiresBuild: true
optionalDependencies:
'@esbuild/android-arm': 0.18.20
'@esbuild/android-arm64': 0.18.20
'@esbuild/android-x64': 0.18.20
'@esbuild/darwin-arm64': 0.18.20
'@esbuild/darwin-x64': 0.18.20
'@esbuild/freebsd-arm64': 0.18.20
'@esbuild/freebsd-x64': 0.18.20
'@esbuild/linux-arm': 0.18.20
'@esbuild/linux-arm64': 0.18.20
'@esbuild/linux-ia32': 0.18.20
'@esbuild/linux-loong64': 0.18.20
'@esbuild/linux-mips64el': 0.18.20
'@esbuild/linux-ppc64': 0.18.20
'@esbuild/linux-riscv64': 0.18.20
'@esbuild/linux-s390x': 0.18.20
'@esbuild/linux-x64': 0.18.20
'@esbuild/netbsd-x64': 0.18.20
'@esbuild/openbsd-x64': 0.18.20
'@esbuild/sunos-x64': 0.18.20
'@esbuild/win32-arm64': 0.18.20
'@esbuild/win32-ia32': 0.18.20
'@esbuild/win32-x64': 0.18.20
'@esbuild/android-arm': 0.19.2
'@esbuild/android-arm64': 0.19.2
'@esbuild/android-x64': 0.19.2
'@esbuild/darwin-arm64': 0.19.2
'@esbuild/darwin-x64': 0.19.2
'@esbuild/freebsd-arm64': 0.19.2
'@esbuild/freebsd-x64': 0.19.2
'@esbuild/linux-arm': 0.19.2
'@esbuild/linux-arm64': 0.19.2
'@esbuild/linux-ia32': 0.19.2
'@esbuild/linux-loong64': 0.19.2
'@esbuild/linux-mips64el': 0.19.2
'@esbuild/linux-ppc64': 0.19.2
'@esbuild/linux-riscv64': 0.19.2
'@esbuild/linux-s390x': 0.19.2
'@esbuild/linux-x64': 0.19.2
'@esbuild/netbsd-x64': 0.19.2
'@esbuild/openbsd-x64': 0.19.2
'@esbuild/sunos-x64': 0.19.2
'@esbuild/win32-arm64': 0.19.2
'@esbuild/win32-ia32': 0.19.2
'@esbuild/win32-x64': 0.19.2
dev: true
/escalade@3.1.1:
@ -2251,13 +2251,13 @@ packages:
engines: {node: '>=10'}
dev: true
/eslint-config-prettier@9.0.0(eslint@8.46.0):
/eslint-config-prettier@9.0.0(eslint@8.47.0):
resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==}
hasBin: true
peerDependencies:
eslint: '>=7.0.0'
dependencies:
eslint: 8.46.0
eslint: 8.47.0
dev: true
/eslint-define-config@1.23.0:
@ -2269,13 +2269,13 @@ packages:
resolution: {integrity: sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==}
dependencies:
debug: 3.2.7
is-core-module: 2.12.1
is-core-module: 2.13.0
resolve: 1.22.4
transitivePeerDependencies:
- supports-color
dev: true
/eslint-module-utils@2.8.0(eslint-import-resolver-node@0.3.7)(eslint@8.46.0):
/eslint-module-utils@2.8.0(eslint-import-resolver-node@0.3.7)(eslint@8.47.0):
resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==}
engines: {node: '>=4'}
peerDependencies:
@ -2297,14 +2297,14 @@ packages:
optional: true
dependencies:
debug: 3.2.7
eslint: 8.46.0
eslint: 8.47.0
eslint-import-resolver-node: 0.3.7
transitivePeerDependencies:
- supports-color
dev: true
/eslint-plugin-import@2.28.0(eslint@8.46.0):
resolution: {integrity: sha512-B8s/n+ZluN7sxj9eUf7/pRFERX0r5bnFA2dCaLHy2ZeaQEAz0k+ZZkFWRFHJAqxfxQDx6KLv9LeIki7cFdwW+Q==}
/eslint-plugin-import@2.28.1(eslint@8.47.0):
resolution: {integrity: sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==}
engines: {node: '>=4'}
peerDependencies:
'@typescript-eslint/parser': '*'
@ -2319,17 +2319,16 @@ packages:
array.prototype.flatmap: 1.3.1
debug: 3.2.7
doctrine: 2.1.0
eslint: 8.46.0
eslint: 8.47.0
eslint-import-resolver-node: 0.3.7
eslint-module-utils: 2.8.0(eslint-import-resolver-node@0.3.7)(eslint@8.46.0)
eslint-module-utils: 2.8.0(eslint-import-resolver-node@0.3.7)(eslint@8.47.0)
has: 1.0.3
is-core-module: 2.12.1
is-core-module: 2.13.0
is-glob: 4.0.3
minimatch: 3.1.2
object.fromentries: 2.0.6
object.groupby: 1.0.0
object.values: 1.1.6
resolve: 1.22.4
semver: 6.3.1
tsconfig-paths: 3.14.2
transitivePeerDependencies:
@ -2338,17 +2337,17 @@ packages:
- supports-color
dev: true
/eslint-plugin-unicorn@48.0.1(eslint@8.46.0):
/eslint-plugin-unicorn@48.0.1(eslint@8.47.0):
resolution: {integrity: sha512-FW+4r20myG/DqFcCSzoumaddKBicIPeFnTrifon2mWIzlfyvzwyqZjqVP7m4Cqr/ZYisS2aiLghkUWaPg6vtCw==}
engines: {node: '>=16'}
peerDependencies:
eslint: '>=8.44.0'
dependencies:
'@babel/helper-validator-identifier': 7.22.5
'@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0)
'@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0)
ci-info: 3.8.0
clean-regexp: 1.0.0
eslint: 8.46.0
eslint: 8.47.0
esquery: 1.5.0
indent-string: 4.0.0
is-builtin-module: 3.2.1
@ -2370,20 +2369,20 @@ packages:
estraverse: 5.3.0
dev: true
/eslint-visitor-keys@3.4.2:
resolution: {integrity: sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==}
/eslint-visitor-keys@3.4.3:
resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/eslint@8.46.0:
resolution: {integrity: sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==}
/eslint@8.47.0:
resolution: {integrity: sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
hasBin: true
dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0)
'@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0)
'@eslint-community/regexpp': 4.6.2
'@eslint/eslintrc': 2.1.1
'@eslint/js': 8.46.0
'@eslint/eslintrc': 2.1.2
'@eslint/js': 8.47.0
'@humanwhocodes/config-array': 0.11.10
'@humanwhocodes/module-importer': 1.0.1
'@nodelib/fs.walk': 1.2.8
@ -2394,7 +2393,7 @@ packages:
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.2.2
eslint-visitor-keys: 3.4.2
eslint-visitor-keys: 3.4.3
espree: 9.6.1
esquery: 1.5.0
esutils: 2.0.3
@ -2427,7 +2426,7 @@ packages:
dependencies:
acorn: 8.10.0
acorn-jsx: 5.3.2(acorn@8.10.0)
eslint-visitor-keys: 3.4.2
eslint-visitor-keys: 3.4.3
dev: true
/esquery@1.5.0:
@ -2901,8 +2900,8 @@ packages:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
dev: true
/json-schema-to-ts@2.9.1:
resolution: {integrity: sha512-8MNpRGERlCUWYeJwsWkMrJ0MWzBz49dfqpG+n9viiIlP4othaahbiaNQZuBzmPxRLUhOv1QJMCzW5WE8nHFGIQ==}
/json-schema-to-ts@2.9.2:
resolution: {integrity: sha512-h9WqLkTVpBbiaPb5OmeUpz/FBLS/kvIJw4oRCPiEisIu2WjMh+aai0QIY2LoOhRFx5r92taGLcerIrzxKBAP6g==}
engines: {node: '>=16'}
dependencies:
'@babel/runtime': 7.21.5
@ -3200,8 +3199,8 @@ packages:
engines: {node: '>= 0.8.0'}
dev: true
/prettier@3.0.1:
resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==}
/prettier@3.0.2:
resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==}
engines: {node: '>=14'}
hasBin: true
dev: true

View File

@ -4,6 +4,8 @@ import type { ESLintConfig } from 'eslint-define-config';
const { name } = (0, require)('./package.json');
const unique = <T>(arr: T[]): T[] => [...new Set(arr)];
const ensureArray = <T>(value?: T | T[]): T[] =>
value == null ? [] : Array.isArray(value) ? value : [value];
const error = 'error';
const warn = 'warn';
@ -25,6 +27,7 @@ export function extendConfig({
const hasReact = plugins?.includes('react');
const hasUnicorn = plugins?.includes('unicorn');
const hasReactRefresh = plugins?.includes('react-refresh');
const hasNext = ensureArray(_extends).some(name => name.includes(':@next/next'));
const result: ESLintConfig = {
root: true,
@ -151,7 +154,10 @@ export function extendConfig({
'react/no-children-prop': error,
'react/prop-types': off,
'react/react-in-jsx-scope': off,
'react/no-unknown-property': [error, { extends: ['emotion'] }],
'react/no-unknown-property': [
error,
{ extends: hasNext ? ['emotion', 'next'] : ['emotion'] },
],
}
: {}),
...(hasUnicorn