@@ -1072,7 +1072,7 @@ module.exports = {
10721072 ' ./tsconfig.test.json' ,
10731073 ],
10741074 },
1075- // $ pnpm add -D eslint@^8.0.0 eslint-config-airbnb eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y eslint-config-airbnb-typescript @typescript-eslint/eslint-plugin@^7.0.0 @typescript-eslint/parser@^7.0.0 eslint-plugin-no-unsanitized eslint-plugin-react-perf @tanstack/eslint-plugin-query eslint-plugin-unicorn eslint-plugin-promise eslint-plugin-regexp eslint-plugin-jsdoc eslint-plugin-eslint-comments
1075+ // $ pnpm add -D eslint@^8.0.0 eslint-config-airbnb eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y eslint-config-airbnb-typescript @typescript-eslint/eslint-plugin@^7.0.0 @typescript-eslint/parser@^7.0.0 eslint-plugin-no-unsanitized eslint-plugin-risxss eslint-plugin- react-perf @tanstack/eslint-plugin-query eslint-plugin-unicorn eslint-plugin-promise eslint-plugin-regexp eslint-plugin-jsdoc eslint-plugin-eslint-comments
10761076 extends: [
10771077 ' airbnb' ,
10781078 ' airbnb/hooks' ,
@@ -1092,6 +1092,9 @@ module.exports = {
10921092 ' plugin:jsdoc/recommended-typescript' ,
10931093 ' plugin:eslint-comments/recommended' ,
10941094 ],
1095+ plugin: [
1096+ ' risxss' ,
1097+ ],
10951098 rules: {
10961099 // React 17+ 不用再引入 React
10971100 ' react/react-in-jsx-scope' : ' off' ,
@@ -1100,6 +1103,12 @@ module.exports = {
11001103 ' unicorn/prevent-abbreviations' : ' off' ,
11011104 // Airbnb 更喜欢使用 forEach
11021105 ' unicorn/no-array-for-each' : ' off' ,
1106+ // null 在项目中是常见场景
1107+ ' unicorn/no-null' : ' off' ,
1108+ // airbnb风格指南要求"基本文件名应该完全匹配其默认导出的名称"
1109+ ' unicorn/filename-case' : ' off' ,
1110+ // RisXSS 规则,预防 XSS 攻击
1111+ ' risxss/catch-potential-xss-react' : ' error' ,
11031112 },
11041113 overrides: [
11051114 {
@@ -1130,6 +1139,13 @@ module.exports = {
11301139 ' plugin:no-unsanitized/recommended-legacy' ,
11311140 ' plugin:tailwindcss/recommended' ,
11321141 ],
1142+ plugin: [
1143+ ' risxss' ,
1144+ ],
1145+ rules: {
1146+ // RisXSS 规则,预防 XSS 攻击
1147+ ' risxss/catch-potential-xss-vue' : ' error' ,
1148+ },
11331149};
11341150```
11351151 </TabItem >
0 commit comments