File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ const compat_grant = require ( "eslint-plugin-userscripts/dist/data/compat-grant.js" ) ;
2+ const compatMap = {
3+ CAT_userConfig : [ { type : "scriptcat" , versionConstraint : ">=0.11.0-beta" } ] ,
4+ CAT_fileStorage : [ { type : "scriptcat" , versionConstraint : ">=0.11.0" } ] ,
5+ ...compat_grant . compatMap ,
6+ } ;
7+
8+ const gmPolyfillOverride = {
9+ ...compat_grant . gmPolyfillOverride ,
10+ } ;
11+
12+ module . exports = { compatMap, gmPolyfillOverride } ;
Original file line number Diff line number Diff line change 1+ const compat_headers = require ( "eslint-plugin-userscripts/dist/data/compat-headers.js" ) ;
2+
3+ const compatMap = {
4+ ...compat_headers . compatMap ,
5+ nonFunctional : {
6+ ...compat_headers . compatMap . nonFunctional ,
7+ // 覆盖或新增新的属性
8+ background : [ ] ,
9+ crontab : [ ] ,
10+ cloudCat : [ ] ,
11+ cloudServer : [ ] ,
12+ exportValue : [ ] ,
13+ exportCookie : [ ] ,
14+ scriptUrl : [ ] ,
15+ storageName : [ ] ,
16+ } ,
17+ } ;
18+
19+ module . exports = { compatMap } ;
Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ export default defineConfig({
5252 alias : {
5353 "@App" : path . resolve ( __dirname , "src/" ) ,
5454 "@Packages" : path . resolve ( __dirname , "packages/" ) ,
55+ // 改写eslint-plugin-userscripts以适配脚本猫,打包时重定义模块路径
56+ "../data/compat-grant" : path . resolve ( __dirname , "packages/eslint/compat-grant" ) ,
57+ "../data/compat-headers" : path . resolve ( __dirname , "packages/eslint/compat-headers" ) ,
5558 } ,
5659 fallback : {
5760 child_process : false ,
You can’t perform that action at this time.
0 commit comments