@eslint-sukka/shared 4.0.2 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("path"),
|
|
1
|
+
"use strict";var e=require("path"),s=require("fs");const a="?([cm])[jt]s?(x)",t=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`];var p=Object.freeze({__proto__:null,GLOB_EXCLUDE:["**/node_modules","**/dist","**/output","**/out","**/coverage","**/temp","**/tmp","**/.vitepress/cache","**/.next","**/.nuxt","**/.vercel","**/.changeset","**/.idea","**/.output","**/.vite-inspect","**/*.md","**/*.min.*","**/__snapshots__","**/fixtures","**/auto-import?(s).d.ts","**/components.d.ts"],GLOB_JS:"**/*.?([cm])js",GLOB_JSX:"**/*.?([cm])jsx",GLOB_SRC:"**/*.?([cm])[jt]s?(x)",GLOB_SRC_EXT:a,GLOB_TESTS:t,GLOB_TS:"**/*.?([cm])ts",GLOB_TSX:"**/*.?([cm])tsx"});const m=new class{get(e){let s=this.map.get(e),a=Date.now();if(s){if(s.expire>a)return s.expire=a+2e4,s.value;this.map.delete(e)}return null}set(e,s){let a=this.map.get(e),t=Date.now()+2e4;a?(a.value=s,a.expire=t):this.map.set(e,{value:s,expire:t})}constructor(){var e;e=new Map,"map"in this?Object.defineProperty(this,"map",{value:e,enumerable:!0,configurable:!0,writable:!0}):this.map=e}},o=Object.entries({"deep-equal":"https://www.npmjs.com/package/dequal","fast-deep-equal":"https://www.npmjs.com/package/dequal",chalk:"https://www.npmjs.com/package/picocolors",kleur:"https://www.npmjs.com/package/picocolors","mime-db":"https://www.npmjs.com/package/mrmime","mime-types":"https://www.npmjs.com/package/mrmime","tiny-lru":"https://www.npmjs.com/package/flru","lru-cache":"https://www.npmjs.com/package/flru","tmp-cache":"https://www.npmjs.com/package/flru",premove:"Node.js built-in fs.rmdir & fs.rm API",mkdirp:"Node.js built-in fs.mkdir API","make-dir":"Node.js built-in fs.mkdir API","mk-dirs":"Node.js built-in fs.mkdir API",axios:"https://www.npmjs.com/package/ky","node-fetch":"https://www.npmjs.com/package/undici",got:"https://www.npmjs.com/package/undici and https://www.npmjs.com/package/async-retry","react-query":"https://swr.vercel.app","@tanstack/react-query":"https://swr.vercel.app","@tanstack/react-query-devtools":"https://swr.vercel.app",ahooks:"https://foxact.skk.moe and https://swr.vercel.app","clone-deep":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser","deep-copy":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser","fast-copy":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser","lodash.clonedeep":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser",clone:"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser",ms:"https://www.npmjs.com/package/@lukeed/ms",classnames:"https://www.npmjs.com/package/clsx","p-limit":"https://www.npmjs.com/package/async-sema","p-retry":"https://www.npmjs.com/package/async-retry"}).map(([e,s])=>({name:e,message:`Use ${s} instead.`})),c=[{name:"date-fns/esm",message:"Please use date-fns/{submodule} instead."},{name:"idb/with-async-ittr-cjs",message:"Please use idb/with-async-ittr instead."},{name:"lodash-unified",message:"Do not import lodash-unified directly"},{name:"react-fast-compare",message:"What's faster than a really fast deep comparison? No deep comparison at all."}],n=[{name:"lodash",message:"Avoid using type unsafe methods.",importNames:["get"]},{name:"lodash-es",message:"Avoid using type unsafe methods.",importNames:["get"]},{name:"lodash",message:"Use https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser instead",importNames:["cloneDeep"]},{name:"lodash-es",message:"Use https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser instead",importNames:["cloneDeep"]},{name:"uuid",importNames:["v4"],message:"Use https://www.npmjs.com/package/@lukeed/uuid instead"}],r=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...c,...o,...n],l=[{name:"date-fns",message:"Please use date-fns/{submodule} instead.",allowTypeImports:!0},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead.",allowTypeImports:!0},...c,...o,...n],w=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...c,...o];exports.BETTER_ALTERNATIVES=o,exports.RESTRICTED_IMPORT_JS=r,exports.RESTRICTED_IMPORT_NODE_REQUIRE=w,exports.RESTRICTED_IMPORT_TS=l,exports.constants=p,exports.getPackageJson=function(a="a.js"){let t=e.dirname(e.resolve(a)),p=t,o="",c=null;do{if(c=m.get(p))return p!==t&&m.set(t,c),c;if(c=function(a){let t=e.join(a,"package.json");try{let e=s.readFileSync(t,"utf8"),a=JSON.parse(e);if(a&&"object"==typeof a)return a.filePath=t,a}catch{}return null}(p))return m.set(p,c),m.set(t,c),c;o=p,p=e.resolve(p,"..")}while(p!==o);return m.set(t,null),null};
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,29 @@ declare namespace constants {
|
|
|
31
31
|
*/
|
|
32
32
|
declare function getPackageJson(startPath?: string): Record<string, any> | null;
|
|
33
33
|
|
|
34
|
+
/** 福妮严选 */
|
|
35
|
+
declare const BETTER_ALTERNATIVES: {
|
|
36
|
+
name: string;
|
|
37
|
+
message: string;
|
|
38
|
+
}[];
|
|
39
|
+
declare const RESTRICTED_IMPORT_JS: {
|
|
40
|
+
name: string;
|
|
41
|
+
message: string;
|
|
42
|
+
}[];
|
|
43
|
+
declare const RESTRICTED_IMPORT_TS: ({
|
|
44
|
+
name: string;
|
|
45
|
+
message: string;
|
|
46
|
+
} | {
|
|
47
|
+
name: string;
|
|
48
|
+
message: string;
|
|
49
|
+
allowTypeImports: boolean;
|
|
50
|
+
})[];
|
|
51
|
+
declare const RESTRICTED_IMPORT_NODE_REQUIRE: {
|
|
52
|
+
name: string;
|
|
53
|
+
message: string;
|
|
54
|
+
}[];
|
|
55
|
+
|
|
34
56
|
type FlatESLintConfigItem = Linter.FlatConfig;
|
|
35
57
|
type SukkaESLintRuleConfig = Pick<FlatESLintConfigItem, 'plugins' | 'rules'>;
|
|
36
58
|
|
|
37
|
-
export { type FlatESLintConfigItem, type SukkaESLintRuleConfig, constants, getPackageJson };
|
|
59
|
+
export { BETTER_ALTERNATIVES, type FlatESLintConfigItem, RESTRICTED_IMPORT_JS, RESTRICTED_IMPORT_NODE_REQUIRE, RESTRICTED_IMPORT_TS, type SukkaESLintRuleConfig, constants, getPackageJson };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("path"),
|
|
1
|
+
"use strict";var e=require("path"),s=require("fs");const a="?([cm])[jt]s?(x)",t=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`];var p=Object.freeze({__proto__:null,GLOB_EXCLUDE:["**/node_modules","**/dist","**/output","**/out","**/coverage","**/temp","**/tmp","**/.vitepress/cache","**/.next","**/.nuxt","**/.vercel","**/.changeset","**/.idea","**/.output","**/.vite-inspect","**/*.md","**/*.min.*","**/__snapshots__","**/fixtures","**/auto-import?(s).d.ts","**/components.d.ts"],GLOB_JS:"**/*.?([cm])js",GLOB_JSX:"**/*.?([cm])jsx",GLOB_SRC:"**/*.?([cm])[jt]s?(x)",GLOB_SRC_EXT:a,GLOB_TESTS:t,GLOB_TS:"**/*.?([cm])ts",GLOB_TSX:"**/*.?([cm])tsx"});const m=new class{get(e){let s=this.map.get(e),a=Date.now();if(s){if(s.expire>a)return s.expire=a+2e4,s.value;this.map.delete(e)}return null}set(e,s){let a=this.map.get(e),t=Date.now()+2e4;a?(a.value=s,a.expire=t):this.map.set(e,{value:s,expire:t})}constructor(){var e;e=new Map,"map"in this?Object.defineProperty(this,"map",{value:e,enumerable:!0,configurable:!0,writable:!0}):this.map=e}},o=Object.entries({"deep-equal":"https://www.npmjs.com/package/dequal","fast-deep-equal":"https://www.npmjs.com/package/dequal",chalk:"https://www.npmjs.com/package/picocolors",kleur:"https://www.npmjs.com/package/picocolors","mime-db":"https://www.npmjs.com/package/mrmime","mime-types":"https://www.npmjs.com/package/mrmime","tiny-lru":"https://www.npmjs.com/package/flru","lru-cache":"https://www.npmjs.com/package/flru","tmp-cache":"https://www.npmjs.com/package/flru",premove:"Node.js built-in fs.rmdir & fs.rm API",mkdirp:"Node.js built-in fs.mkdir API","make-dir":"Node.js built-in fs.mkdir API","mk-dirs":"Node.js built-in fs.mkdir API",axios:"https://www.npmjs.com/package/ky","node-fetch":"https://www.npmjs.com/package/undici",got:"https://www.npmjs.com/package/undici and https://www.npmjs.com/package/async-retry","react-query":"https://swr.vercel.app","@tanstack/react-query":"https://swr.vercel.app","@tanstack/react-query-devtools":"https://swr.vercel.app",ahooks:"https://foxact.skk.moe and https://swr.vercel.app","clone-deep":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser","deep-copy":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser","fast-copy":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser","lodash.clonedeep":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser",clone:"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser",ms:"https://www.npmjs.com/package/@lukeed/ms",classnames:"https://www.npmjs.com/package/clsx","p-limit":"https://www.npmjs.com/package/async-sema","p-retry":"https://www.npmjs.com/package/async-retry"}).map(([e,s])=>({name:e,message:`Use ${s} instead.`})),c=[{name:"date-fns/esm",message:"Please use date-fns/{submodule} instead."},{name:"idb/with-async-ittr-cjs",message:"Please use idb/with-async-ittr instead."},{name:"lodash-unified",message:"Do not import lodash-unified directly"},{name:"react-fast-compare",message:"What's faster than a really fast deep comparison? No deep comparison at all."}],n=[{name:"lodash",message:"Avoid using type unsafe methods.",importNames:["get"]},{name:"lodash-es",message:"Avoid using type unsafe methods.",importNames:["get"]},{name:"lodash",message:"Use https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser instead",importNames:["cloneDeep"]},{name:"lodash-es",message:"Use https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser instead",importNames:["cloneDeep"]},{name:"uuid",importNames:["v4"],message:"Use https://www.npmjs.com/package/@lukeed/uuid instead"}],r=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...c,...o,...n],l=[{name:"date-fns",message:"Please use date-fns/{submodule} instead.",allowTypeImports:!0},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead.",allowTypeImports:!0},...c,...o,...n],w=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...c,...o];exports.BETTER_ALTERNATIVES=o,exports.RESTRICTED_IMPORT_JS=r,exports.RESTRICTED_IMPORT_NODE_REQUIRE=w,exports.RESTRICTED_IMPORT_TS=l,exports.constants=p,exports.getPackageJson=function(a="a.js"){let t=e.dirname(e.resolve(a)),p=t,o="",c=null;do{if(c=m.get(p))return p!==t&&m.set(t,c),c;if(c=function(a){let t=e.join(a,"package.json");try{let e=s.readFileSync(t,"utf8"),a=JSON.parse(e);if(a&&"object"==typeof a)return a.filePath=t,a}catch{}return null}(p))return m.set(p,c),m.set(t,c),c;o=p,p=e.resolve(p,"..")}while(p!==o);return m.set(t,null),null};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"path";import
|
|
1
|
+
import e from"path";import s from"fs";let a="?([cm])[jt]s?(x)",t=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`];var p=Object.freeze({__proto__:null,GLOB_EXCLUDE:["**/node_modules","**/dist","**/output","**/out","**/coverage","**/temp","**/tmp","**/.vitepress/cache","**/.next","**/.nuxt","**/.vercel","**/.changeset","**/.idea","**/.output","**/.vite-inspect","**/*.md","**/*.min.*","**/__snapshots__","**/fixtures","**/auto-import?(s).d.ts","**/components.d.ts"],GLOB_JS:"**/*.?([cm])js",GLOB_JSX:"**/*.?([cm])jsx",GLOB_SRC:"**/*.?([cm])[jt]s?(x)",GLOB_SRC_EXT:a,GLOB_TESTS:t,GLOB_TS:"**/*.?([cm])ts",GLOB_TSX:"**/*.?([cm])tsx"});let m=new class{get(e){let s=this.map.get(e),a=Date.now();if(s){if(s.expire>a)return s.expire=a+2e4,s.value;this.map.delete(e)}return null}set(e,s){let a=this.map.get(e),t=Date.now()+2e4;a?(a.value=s,a.expire=t):this.map.set(e,{value:s,expire:t})}constructor(){var e;e=new Map,"map"in this?Object.defineProperty(this,"map",{value:e,enumerable:!0,configurable:!0,writable:!0}):this.map=e}};function o(a="a.js"){let t=e.dirname(e.resolve(a)),p=t,o="",c=null;do{if(c=m.get(p))return p!==t&&m.set(t,c),c;if(c=function(a){let t=e.join(a,"package.json");try{let e=s.readFileSync(t,"utf8"),a=JSON.parse(e);if(a&&"object"==typeof a)return a.filePath=t,a}catch{}return null}(p))return m.set(p,c),m.set(t,c),c;o=p,p=e.resolve(p,"..")}while(p!==o);return m.set(t,null),null}let c=Object.entries({"deep-equal":"https://www.npmjs.com/package/dequal","fast-deep-equal":"https://www.npmjs.com/package/dequal",chalk:"https://www.npmjs.com/package/picocolors",kleur:"https://www.npmjs.com/package/picocolors","mime-db":"https://www.npmjs.com/package/mrmime","mime-types":"https://www.npmjs.com/package/mrmime","tiny-lru":"https://www.npmjs.com/package/flru","lru-cache":"https://www.npmjs.com/package/flru","tmp-cache":"https://www.npmjs.com/package/flru",premove:"Node.js built-in fs.rmdir & fs.rm API",mkdirp:"Node.js built-in fs.mkdir API","make-dir":"Node.js built-in fs.mkdir API","mk-dirs":"Node.js built-in fs.mkdir API",axios:"https://www.npmjs.com/package/ky","node-fetch":"https://www.npmjs.com/package/undici",got:"https://www.npmjs.com/package/undici and https://www.npmjs.com/package/async-retry","react-query":"https://swr.vercel.app","@tanstack/react-query":"https://swr.vercel.app","@tanstack/react-query-devtools":"https://swr.vercel.app",ahooks:"https://foxact.skk.moe and https://swr.vercel.app","clone-deep":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser","deep-copy":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser","fast-copy":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser","lodash.clonedeep":"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser",clone:"https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser",ms:"https://www.npmjs.com/package/@lukeed/ms",classnames:"https://www.npmjs.com/package/clsx","p-limit":"https://www.npmjs.com/package/async-sema","p-retry":"https://www.npmjs.com/package/async-retry"}).map(([e,s])=>({name:e,message:`Use ${s} instead.`})),n=[{name:"date-fns/esm",message:"Please use date-fns/{submodule} instead."},{name:"idb/with-async-ittr-cjs",message:"Please use idb/with-async-ittr instead."},{name:"lodash-unified",message:"Do not import lodash-unified directly"},{name:"react-fast-compare",message:"What's faster than a really fast deep comparison? No deep comparison at all."}],r=[{name:"lodash",message:"Avoid using type unsafe methods.",importNames:["get"]},{name:"lodash-es",message:"Avoid using type unsafe methods.",importNames:["get"]},{name:"lodash",message:"Use https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser instead",importNames:["cloneDeep"]},{name:"lodash-es",message:"Use https://www.npmjs.com/package/rfdc for Node.js / https://www.npmjs.com/package/klona for Browser instead",importNames:["cloneDeep"]},{name:"uuid",importNames:["v4"],message:"Use https://www.npmjs.com/package/@lukeed/uuid instead"}],l=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...n,...c,...r],w=[{name:"date-fns",message:"Please use date-fns/{submodule} instead.",allowTypeImports:!0},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead.",allowTypeImports:!0},...n,...c,...r],i=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...n,...c];export{c as BETTER_ALTERNATIVES,l as RESTRICTED_IMPORT_JS,i as RESTRICTED_IMPORT_NODE_REQUIRE,w as RESTRICTED_IMPORT_TS,p as constants,o as getPackageJson};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-sukka/shared",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "Sukka's ESLint config",
|
|
5
5
|
"author": "Sukka <https://skk.moe>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@types/eslint": "^8.44.
|
|
31
|
+
"@types/eslint": "^8.44.4"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "rollup -c rollup.config.ts --configPlugin swc3"
|