@eslint-sukka/shared 6.0.0-beta.3 → 6.0.0-beta.31
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 +2 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -4
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("path"),s=require("fs");const
|
|
1
|
+
"use strict";var e=require("path"),s=require("fs"),t=require("@dual-bundle/import-meta-resolve");const a="?([cm])[jt]s?(x)",p="**/*.json",o="**/*.jsonc",r="**/*.json5",n=[`**/__tests__/**/*.${a}`,`**/*.spec.${a}`,`**/*.test.${a}`];var m=Object.freeze({__proto__:null,GLOB_ALL_JSON:[p,o,r],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_JSON:p,GLOB_JSON5:r,GLOB_JSONC:o,GLOB_JSX:"**/*.?([cm])jsx",GLOB_SRC:"**/*.?([cm])[jt]s?(x)",GLOB_SRC_EXT:a,GLOB_TESTS:n,GLOB_TS:"**/*.?([cm])ts",GLOB_TSX:"**/*.?([cm])tsx"});const c=new class{get(e){let s=this.map.get(e),t=Date.now();if(s){if(s.expire>t)return s.expire=t+2e4,s.value;this.map.delete(e)}return null}set(e,s){let t=this.map.get(e),a=Date.now()+2e4;t?(t.value=s,t.expire=a):this.map.set(e,{value:s,expire:a})}constructor(){var e;e=new Map,"map"in this?Object.defineProperty(this,"map",{value:e,enumerable:!0,configurable:!0,writable:!0}):this.map=e}},l=Object.entries({"deep-equal":"https://www.npmjs.com/package/dequal","fast-deep-equal":"https://www.npmjs.com/package/dequal",chalk:"simple color https://www.npmjs.com/package/picocolors, hex color https://github.com/webdiscus/ansis",kleur:"https://www.npmjs.com/package/picocolors","ansi-escapes":"https://www.npmjs.com/package/sisteransi","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 (preferred) or https://www.npmjs.com/package/node-fetch-native",got:"https://www.npmjs.com/package/undici and https://www.npmjs.com/package/async-retry","get-port":"https://www.npmjs.com/package/get-port-please","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",classcat:"https://www.npmjs.com/package/clsx","p-limit":"https://www.npmjs.com/package/async-sema","p-retry":"https://www.npmjs.com/package/async-retry",ora:"https://www.npmjs.com/package/nanospinner","ts-results":"https://www.npmjs.com/package/ts-results-es",dayjs:"https://www.npmjs.com/package/date-fns",tldjs:"https://www.npmjs.com/package/tldts"}).map(([e,s])=>({name:e,message:`Use ${s} instead.`})),i=[{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."}],w=[{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"},{name:"assert",importNames:["deepEqual"],message:"Use https://www.npmjs.com/package/dequal instead"},{name:"react",importNames:["default"],message:"Use named import instead"}],d=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...i,...l,...w],u=[{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},...i,...l,...w],h=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...i,...l];Object.defineProperty(exports,"importMetaResolve",{enumerable:!0,get:function(){return t.resolve}}),exports.BETTER_ALTERNATIVES=l,exports.RESTRICTED_IMPORT_JS=d,exports.RESTRICTED_IMPORT_NODE_REQUIRE=h,exports.RESTRICTED_IMPORT_TS=u,exports.constants=m,exports.createRule=function({name:e,meta:s,create:t,resolveOptions:a}){if(s.docs){var p;(p=s.docs).url??(p.url=new URL(e,"https://eslint-plugin.skk.moe/src/rules/").toString())}return{name:e,meta:s,create(e){let s=a?.(...e.options)??e.options[0];return Object.fromEntries(Object.entries(t(e,s)).filter(e=>e[1]))}}},exports.ensureParserWithTypeInformation=function(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")},exports.getPackageJson=function(t="a.js"){let a=e.dirname(e.resolve(t)),p=a,o="",r=null;do{if(r=c.get(p))return p!==a&&c.set(a,r),r;if(r=function(t){let a=e.join(t,"package.json");try{let e=s.readFileSync(a,"utf8"),t=JSON.parse(e);if(t&&"object"==typeof t)return t.filePath=a,t}catch{}return null}(p))return c.set(p,r),c.set(a,r),r;o=p,p=e.resolve(p,"..")}while(p!==o);return c.set(a,null),null},exports.memo=(e,s)=>{var t,a,p;let o=s;if(!o){if("function"==typeof e.toString)o=e.toString();else throw TypeError("memo() requires a key!")}return(t=globalThis).__ESLINT_PLUGIN_MEMO__||(t.__ESLINT_PLUGIN_MEMO__={}),(a=globalThis.__ESLINT_PLUGIN_MEMO__)[p=o]||(a[p]=e),globalThis.__ESLINT_PLUGIN_MEMO__[o]};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Linter } from 'eslint';
|
|
|
2
2
|
import { ParserServices, ParserServicesWithTypeInformation } from '@typescript-eslint/utils';
|
|
3
3
|
import { RuleListener, RuleContext, RuleMetaData } from '@typescript-eslint/utils/ts-eslint';
|
|
4
4
|
export { RuleContext } from '@typescript-eslint/utils/ts-eslint';
|
|
5
|
+
export { resolve as importMetaResolve } from '@dual-bundle/import-meta-resolve';
|
|
5
6
|
|
|
6
7
|
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
7
8
|
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
@@ -99,6 +100,6 @@ interface ExportedRuleModule<TOptions extends readonly unknown[] = unknown[], TM
|
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
declare function createRule<TResolvedOptions, TOptions extends unknown[], TMessageIDs extends string, TRuleListener extends RuleListener = RuleListener>({ name, meta, create, resolveOptions }: RuleModule<TResolvedOptions, TOptions, TMessageIDs, TRuleListener>): any;
|
|
102
|
-
declare function ensureParserWithTypeInformation(parserServices: ParserServices | undefined): asserts parserServices is ParserServicesWithTypeInformation;
|
|
103
|
+
declare function ensureParserWithTypeInformation(parserServices: Partial<ParserServices> | undefined): asserts parserServices is ParserServicesWithTypeInformation;
|
|
103
104
|
|
|
104
105
|
export { BETTER_ALTERNATIVES, type ExportedRuleModule, type FlatESLintConfigItem, RESTRICTED_IMPORT_JS, RESTRICTED_IMPORT_NODE_REQUIRE, RESTRICTED_IMPORT_TS, type RuleModule, type SukkaESLintRuleConfig, constants, createRule, ensureParserWithTypeInformation, getPackageJson, memo };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"path";import s from"fs";let t="?([cm])[jt]s?(x)",a="**/*.json",p="**/*.jsonc",o="**/*.json5",
|
|
1
|
+
import e from"path";import s from"fs";export{resolve as importMetaResolve}from"@dual-bundle/import-meta-resolve";let t="?([cm])[jt]s?(x)",a="**/*.json",p="**/*.jsonc",o="**/*.json5",m=[`**/__tests__/**/*.${t}`,`**/*.spec.${t}`,`**/*.test.${t}`];var n=Object.freeze({__proto__:null,GLOB_ALL_JSON:[a,p,o],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_JSON:a,GLOB_JSON5:o,GLOB_JSONC:p,GLOB_JSX:"**/*.?([cm])jsx",GLOB_SRC:"**/*.?([cm])[jt]s?(x)",GLOB_SRC_EXT:t,GLOB_TESTS:m,GLOB_TS:"**/*.?([cm])ts",GLOB_TSX:"**/*.?([cm])tsx"});let r=new class{get(e){let s=this.map.get(e),t=Date.now();if(s){if(s.expire>t)return s.expire=t+2e4,s.value;this.map.delete(e)}return null}set(e,s){let t=this.map.get(e),a=Date.now()+2e4;t?(t.value=s,t.expire=a):this.map.set(e,{value:s,expire:a})}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 c(t="a.js"){let a=e.dirname(e.resolve(t)),p=a,o="",m=null;do{if(m=r.get(p))return p!==a&&r.set(a,m),m;if(m=function(t){let a=e.join(t,"package.json");try{let e=s.readFileSync(a,"utf8"),t=JSON.parse(e);if(t&&"object"==typeof t)return t.filePath=a,t}catch{}return null}(p))return r.set(p,m),r.set(a,m),m;o=p,p=e.resolve(p,"..")}while(p!==o);return r.set(a,null),null}let l=Object.entries({"deep-equal":"https://www.npmjs.com/package/dequal","fast-deep-equal":"https://www.npmjs.com/package/dequal",chalk:"simple color https://www.npmjs.com/package/picocolors, hex color https://github.com/webdiscus/ansis",kleur:"https://www.npmjs.com/package/picocolors","ansi-escapes":"https://www.npmjs.com/package/sisteransi","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 (preferred) or https://www.npmjs.com/package/node-fetch-native",got:"https://www.npmjs.com/package/undici and https://www.npmjs.com/package/async-retry","get-port":"https://www.npmjs.com/package/get-port-please","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",classcat:"https://www.npmjs.com/package/clsx","p-limit":"https://www.npmjs.com/package/async-sema","p-retry":"https://www.npmjs.com/package/async-retry",ora:"https://www.npmjs.com/package/nanospinner","ts-results":"https://www.npmjs.com/package/ts-results-es",dayjs:"https://www.npmjs.com/package/date-fns",tldjs:"https://www.npmjs.com/package/tldts"}).map(([e,s])=>({name:e,message:`Use ${s} instead.`})),i=[{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."}],w=[{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"},{name:"assert",importNames:["deepEqual"],message:"Use https://www.npmjs.com/package/dequal instead"},{name:"react",importNames:["default"],message:"Use named import instead"}],d=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...i,...l,...w],u=[{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},...i,...l,...w],h=[{name:"date-fns",message:"Please use date-fns/{submodule} instead."},{name:"async-call-rpc",message:"Please use async-call-rpc/full instead."},...i,...l],g=(e,s)=>{var t,a,p;let o=s;if(!o){if("function"==typeof e.toString)o=e.toString();else throw TypeError("memo() requires a key!")}return(t=globalThis).__ESLINT_PLUGIN_MEMO__||(t.__ESLINT_PLUGIN_MEMO__={}),(a=globalThis.__ESLINT_PLUGIN_MEMO__)[p=o]||(a[p]=e),globalThis.__ESLINT_PLUGIN_MEMO__[o]};function f({name:e,meta:s,create:t,resolveOptions:a}){if(s.docs){var p;(p=s.docs).url??(p.url=new URL(e,"https://eslint-plugin.skk.moe/src/rules/").toString())}return{name:e,meta:s,create(e){let s=a?.(...e.options)??e.options[0];return Object.fromEntries(Object.entries(t(e,s)).filter(e=>e[1]))}}}function j(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}export{l as BETTER_ALTERNATIVES,d as RESTRICTED_IMPORT_JS,h as RESTRICTED_IMPORT_NODE_REQUIRE,u as RESTRICTED_IMPORT_TS,n as constants,f as createRule,j as ensureParserWithTypeInformation,c as getPackageJson,g as memo};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-sukka/shared",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.31",
|
|
4
4
|
"description": "Sukka's ESLint config",
|
|
5
5
|
"homepage": "https://github.com/SukkaW/eslint-config-sukka",
|
|
6
6
|
"repository": {
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
"author": "Sukka <https://skk.moe>",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
31
|
+
"@dual-bundle/import-meta-resolve": "^4.1.0",
|
|
32
|
+
"@types/eslint": "^8.56.10",
|
|
33
|
+
"@typescript-eslint/utils": "8.0.0-alpha.30"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
|
-
"@eslint-sukka/rollup-config": "6.0.0-beta.
|
|
36
|
+
"@eslint-sukka/rollup-config": "6.0.0-beta.31"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"build": "rollup -c rollup.config.ts --configPlugin swc3"
|