@eslint-sukka/shared 4.0.0-beta.6

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Sukka <https://skk.moe>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e=require("path"),t=require("fs");const s="?([cm])[jt]s?(x)",r=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`];var n=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:s,GLOB_TESTS:r,GLOB_TS:"**/*.?([cm])ts",GLOB_TSX:"**/*.?([cm])tsx"});const a=new class{get(e){let t=this.map.get(e),s=Date.now();if(t){if(t.expire>s)return t.expire=s+2e4,t.value;this.map.delete(e)}return null}set(e,t){let s=this.map.get(e),r=Date.now()+2e4;s?(s.value=t,s.expire=r):this.map.set(e,{value:t,expire:r})}constructor(){var e;e=new Map,"map"in this?Object.defineProperty(this,"map",{value:e,enumerable:!0,configurable:!0,writable:!0}):this.map=e}};exports.constants=n,exports.getPackageJson=function(s="a.js"){let r=e.dirname(e.resolve(s)),n=r,i="",o=null;do{if(o=a.get(n))return n!==r&&a.set(r,o),o;if(o=function(s){let r=e.join(s,"package.json");try{let e=t.readFileSync(r,"utf8"),s=JSON.parse(e);if(s&&"object"==typeof s)return s.filePath=r,s}catch(e){}return null}(n))return a.set(n,o),a.set(r,o),o;i=n,n=e.resolve(n,"..")}while(n!==i);return a.set(r,null),null};
@@ -0,0 +1,45 @@
1
+ import { FlatESLintConfigItem } from 'eslint-define-config';
2
+
3
+ declare const GLOB_TS = "**/*.?([cm])ts";
4
+ declare const GLOB_TSX = "**/*.?([cm])tsx";
5
+ declare const GLOB_JS = "**/*.?([cm])js";
6
+ declare const GLOB_JSX = "**/*.?([cm])jsx";
7
+ declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
8
+ declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
9
+ declare const GLOB_TESTS: string[];
10
+ declare const GLOB_EXCLUDE: string[];
11
+
12
+ declare const constants_GLOB_EXCLUDE: typeof GLOB_EXCLUDE;
13
+ declare const constants_GLOB_JS: typeof GLOB_JS;
14
+ declare const constants_GLOB_JSX: typeof GLOB_JSX;
15
+ declare const constants_GLOB_SRC: typeof GLOB_SRC;
16
+ declare const constants_GLOB_SRC_EXT: typeof GLOB_SRC_EXT;
17
+ declare const constants_GLOB_TESTS: typeof GLOB_TESTS;
18
+ declare const constants_GLOB_TS: typeof GLOB_TS;
19
+ declare const constants_GLOB_TSX: typeof GLOB_TSX;
20
+ declare namespace constants {
21
+ export {
22
+ constants_GLOB_EXCLUDE as GLOB_EXCLUDE,
23
+ constants_GLOB_JS as GLOB_JS,
24
+ constants_GLOB_JSX as GLOB_JSX,
25
+ constants_GLOB_SRC as GLOB_SRC,
26
+ constants_GLOB_SRC_EXT as GLOB_SRC_EXT,
27
+ constants_GLOB_TESTS as GLOB_TESTS,
28
+ constants_GLOB_TS as GLOB_TS,
29
+ constants_GLOB_TSX as GLOB_TSX,
30
+ };
31
+ }
32
+
33
+ /**
34
+ * Gets a `package.json` data.
35
+ * The data is cached if found, then it's used after.
36
+ *
37
+ * @param startPath - A file path to lookup.
38
+ * @returns A found `package.json` data or `null`.
39
+ * This object have additional property `filePath`.
40
+ */
41
+ declare function getPackageJson(startPath?: string): Record<string, any> | null;
42
+
43
+ type SukkaESLintRuleConfig = Pick<FlatESLintConfigItem, 'plugins' | 'rules'>;
44
+
45
+ export { SukkaESLintRuleConfig, constants, getPackageJson };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e=require("path"),t=require("fs");const s="?([cm])[jt]s?(x)",r=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`];var n=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:s,GLOB_TESTS:r,GLOB_TS:"**/*.?([cm])ts",GLOB_TSX:"**/*.?([cm])tsx"});const a=new class{get(e){let t=this.map.get(e),s=Date.now();if(t){if(t.expire>s)return t.expire=s+2e4,t.value;this.map.delete(e)}return null}set(e,t){let s=this.map.get(e),r=Date.now()+2e4;s?(s.value=t,s.expire=r):this.map.set(e,{value:t,expire:r})}constructor(){var e;e=new Map,"map"in this?Object.defineProperty(this,"map",{value:e,enumerable:!0,configurable:!0,writable:!0}):this.map=e}};exports.constants=n,exports.getPackageJson=function(s="a.js"){let r=e.dirname(e.resolve(s)),n=r,i="",o=null;do{if(o=a.get(n))return n!==r&&a.set(r,o),o;if(o=function(s){let r=e.join(s,"package.json");try{let e=t.readFileSync(r,"utf8"),s=JSON.parse(e);if(s&&"object"==typeof s)return s.filePath=r,s}catch(e){}return null}(n))return a.set(n,o),a.set(r,o),o;i=n,n=e.resolve(n,"..")}while(n!==i);return a.set(r,null),null};
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import e from"path";import t from"fs";let s="?([cm])[jt]s?(x)",r=[`**/__tests__/**/*.${s}`,`**/*.spec.${s}`,`**/*.test.${s}`];var n=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:s,GLOB_TESTS:r,GLOB_TS:"**/*.?([cm])ts",GLOB_TSX:"**/*.?([cm])tsx"});let a=new class{get(e){let t=this.map.get(e),s=Date.now();if(t){if(t.expire>s)return t.expire=s+2e4,t.value;this.map.delete(e)}return null}set(e,t){let s=this.map.get(e),r=Date.now()+2e4;s?(s.value=t,s.expire=r):this.map.set(e,{value:t,expire:r})}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 i(s="a.js"){let r=e.dirname(e.resolve(s)),n=r,i="",o=null;do{if(o=a.get(n))return n!==r&&a.set(r,o),o;if(o=function(s){let r=e.join(s,"package.json");try{let e=t.readFileSync(r,"utf8"),s=JSON.parse(e);if(s&&"object"==typeof s)return s.filePath=r,s}catch(e){}return null}(n))return a.set(n,o),a.set(r,o),o;i=n,n=e.resolve(n,"..")}while(n!==i);return a.set(r,null),null}export{n as constants,i as getPackageJson};
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@eslint-sukka/shared",
3
+ "version": "4.0.0-beta.6",
4
+ "description": "Sukka's ESLint config",
5
+ "author": "Sukka <https://skk.moe>",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/SukkaW/eslint-config-sukka",
8
+ "repository": {
9
+ "url": "https://github.com/SukkaW/eslint-config-sukka",
10
+ "directory": "packages/shared"
11
+ },
12
+ "keywords": [
13
+ "eslint-config"
14
+ ],
15
+ "main": "dist/index.js",
16
+ "module": "dist/index.mjs",
17
+ "types": "dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.mjs",
22
+ "require": "./dist/index.cjs",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "./package.json": "./package.json"
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "dependencies": {
31
+ "@stylistic/eslint-plugin-js": "^0.0.4",
32
+ "eslint-plugin-sukka": "4.0.0-beta.6"
33
+ },
34
+ "scripts": {
35
+ "build": "rollup -c rollup.config.ts --configPlugin swc3"
36
+ }
37
+ }