@2digits/eslint-config 1.2.0 → 1.3.0

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.d.mts CHANGED
@@ -9,7 +9,7 @@ declare const _default: {
9
9
  };
10
10
  };
11
11
  readonly plugins: ["@typescript-eslint", "storybook"];
12
- readonly extends: ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "next", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "next", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "next", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "next", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"];
12
+ readonly extends: ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "next", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "next", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "next", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "next", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"];
13
13
  readonly parser: "@typescript-eslint/parser";
14
14
  readonly env: {
15
15
  readonly es6: true;
@@ -58,6 +58,12 @@ declare const _default: {
58
58
  readonly '@typescript-eslint/no-explicit-any': ["warn"];
59
59
  readonly '@typescript-eslint/no-import-type-side-effects': ["error"];
60
60
  readonly '@typescript-eslint/no-misused-promises': "off";
61
+ readonly 'jsdoc/require-jsdoc': ["error", {
62
+ readonly require: {
63
+ readonly FunctionDeclaration: false;
64
+ };
65
+ }];
66
+ readonly 'jsdoc/tag-lines': ["off"];
61
67
  };
62
68
  readonly overrides: [{
63
69
  readonly files: ["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"];
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ declare const _default: {
9
9
  };
10
10
  };
11
11
  readonly plugins: ["@typescript-eslint", "storybook"];
12
- readonly extends: ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "next", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "next", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "next", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "next", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"];
12
+ readonly extends: ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "next", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "next", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "next", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "prettier"] | ["eslint:recommended", "turbo", "plugin:@tanstack/eslint-plugin-query/recommended", "plugin:jsdoc/recommended-typescript-error", "next", "plugin:tailwindcss/recommended", "plugin:unicorn/recommended", "plugin:@typescript-eslint/strict-type-checked", "plugin:@2digits/recommended", "plugin:react/recommended", "plugin:react-hooks/recommended", "prettier"];
13
13
  readonly parser: "@typescript-eslint/parser";
14
14
  readonly env: {
15
15
  readonly es6: true;
@@ -58,6 +58,12 @@ declare const _default: {
58
58
  readonly '@typescript-eslint/no-explicit-any': ["warn"];
59
59
  readonly '@typescript-eslint/no-import-type-side-effects': ["error"];
60
60
  readonly '@typescript-eslint/no-misused-promises': "off";
61
+ readonly 'jsdoc/require-jsdoc': ["error", {
62
+ readonly require: {
63
+ readonly FunctionDeclaration: false;
64
+ };
65
+ }];
66
+ readonly 'jsdoc/tag-lines': ["off"];
61
67
  };
62
68
  readonly overrides: [{
63
69
  readonly files: ["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"];
package/dist/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  var localPkg = require('local-pkg');
4
4
  var i = require('path');
5
- var L = require('process');
6
- var P = require('fs');
5
+ var q = require('process');
6
+ var S = require('fs');
7
7
  var url = require('url');
8
8
  var constants = require('@2digits/constants');
9
9
  var pathe = require('pathe');
@@ -11,11 +11,11 @@ var pathe = require('pathe');
11
11
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
12
 
13
13
  var i__default = /*#__PURE__*/_interopDefault(i);
14
- var L__default = /*#__PURE__*/_interopDefault(L);
15
- var P__default = /*#__PURE__*/_interopDefault(P);
14
+ var q__default = /*#__PURE__*/_interopDefault(q);
15
+ var S__default = /*#__PURE__*/_interopDefault(S);
16
16
 
17
- var U=localPkg.getPackageInfoSync("next")?.version,k=U?{extends:["next"],rules:{"@next/next/no-html-link-for-pages":"off"}}:{extends:[],rules:void 0};var I=localPkg.getPackageInfoSync("react")?.version,p=I?{extends:["plugin:react/recommended","plugin:react-hooks/recommended"],settings:{react:{version:I}},rules:{"react/prop-types":["off"],"react/react-in-jsx-scope":["off"],"react/jsx-curly-newline":["off"],"react/jsx-newline":["error",{prevent:!1}]}}:{extends:[],settings:void 0,rules:void 0};var x={plugins:["storybook"],overrides:[{files:["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"],rules:{"import/no-anonymous-default-export":"off","storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"warn","storybook/no-redundant-story-name":"warn","storybook/prefer-pascal-case":"warn","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error"}},{files:[".storybook/main.@(js|cjs|mjs|ts)"],rules:{"storybook/no-uninstalled-addons":"error"}}]};var S={directory:"isDirectory",file:"isFile"};function V(t){if(!Object.hasOwnProperty.call(S,t))throw new Error(`Invalid type specified: ${t}`)}var _=(t,e)=>e[S[t]](),A=t=>t instanceof URL?url.fileURLToPath(t):t;function w(t,{cwd:e=L__default.default.cwd(),type:r="file",allowSymlinks:m=!0}={}){V(r),e=A(e);let d=m?P__default.default.statSync:P__default.default.lstatSync;for(let c of t)try{let a=d(i__default.default.resolve(e,c),{throwIfNoEntry:!1});if(!a)continue;if(_(r,a))return c}catch{}}function b(t){return t instanceof URL?url.fileURLToPath(t):t}var M=Symbol("findUpStop");function z(t,e={}){let r=i__default.default.resolve(b(e.cwd)??""),{root:m}=i__default.default.parse(r),d=i__default.default.resolve(r,b(e.stopAt)??m),c=e.limit??Number.POSITIVE_INFINITY,a=[t].flat(),N=n=>{if(typeof t!="function")return w(a,n);let h=t(n.cwd);return typeof h=="string"?w([h],n):h},y=[];for(;;){let n=N({...e,cwd:r});if(n===M||(n&&y.push(i__default.default.resolve(r,n)),r===d||y.length>=c))break;r=i__default.default.dirname(r);}return y}function u(t,e={}){return z(t,{...e,limit:1})[0]}var T=u(["tailwind.config.ts","tailwind.config.js"]),D=localPkg.getPackageInfoSync("tailwindcss")?.version,l=D&&T?{extends:["plugin:tailwindcss/recommended"],settings:{tailwindcss:{callees:constants.tailwindFunctions,config:T}},rules:{"tailwindcss/classnames-order":["off"]}}:{extends:[],settings:void 0,rules:void 0};var E=u(["pnpm-workspace.yaml","pnpm-lock.yaml"]),X=E&&pathe.dirname(E),s={parserOptions:{EXPERIMENTAL_useProjectService:!0,tsconfigRootDir:X},plugins:["@typescript-eslint"],extends:["plugin:@typescript-eslint/strict-type-checked"],parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"@typescript-eslint/consistent-type-exports":["error"],"@typescript-eslint/consistent-type-imports":["error",{prefer:"type-imports",disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"@typescript-eslint/no-empty-interface":["error",{allowSingleExtends:!0}],"@typescript-eslint/no-explicit-any":["warn"],"@typescript-eslint/no-import-type-side-effects":["error"],"@typescript-eslint/no-misused-promises":"off"}};var v={extends:["plugin:unicorn/recommended"],rules:{"unicorn/filename-case":["off"],"unicorn/prefer-module":["off"],"unicorn/prevent-abbreviations":["off"],"unicorn/prefer-ternary":["error","only-single-line"],"unicorn/no-useless-undefined":["error",{checkArguments:!1}],"unicorn/prefer-top-level-await":["off"]}};var Ze={root:!0,parserOptions:{sourceType:"module",cacheLifetime:{glob:"Infinity"},...s.parserOptions},plugins:[...s.plugins,...x.plugins],extends:["eslint:recommended","turbo","plugin:@tanstack/eslint-plugin-query/recommended",...k.extends,...l.extends,...v.extends,...s.extends,"plugin:@2digits/recommended",...p.extends,"prettier"],parser:s.parser,env:{es6:!0,node:!0},ignorePatterns:["node_modules","dist","build","coverage","public","tmp","tmp-build","!.prettierrc.js","templates"],settings:{...p.settings,...l.settings},rules:{...s.rules,...p.rules,...v.rules,...l.rules,"sort-imports":["off"],"max-params":["warn"]},overrides:[...x.overrides]};
17
+ var x={extends:["plugin:jsdoc/recommended-typescript-error"],rules:{"jsdoc/require-jsdoc":["error",{require:{FunctionDeclaration:!1}}],"jsdoc/tag-lines":["off"]}};var U=localPkg.getPackageInfoSync("next")?.version,I=U?{extends:["next"],rules:{"@next/next/no-html-link-for-pages":"off"}}:{extends:[],rules:void 0};var P=localPkg.getPackageInfoSync("react")?.version,p=P?{extends:["plugin:react/recommended","plugin:react-hooks/recommended"],settings:{react:{version:P}},rules:{"react/prop-types":["off"],"react/react-in-jsx-scope":["off"],"react/jsx-curly-newline":["off"],"react/jsx-newline":["error",{prevent:!1}]}}:{extends:[],settings:void 0,rules:void 0};var g={plugins:["storybook"],overrides:[{files:["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"],rules:{"import/no-anonymous-default-export":"off","storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"warn","storybook/no-redundant-story-name":"warn","storybook/prefer-pascal-case":"warn","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error"}},{files:[".storybook/main.@(js|cjs|mjs|ts)"],rules:{"storybook/no-uninstalled-addons":"error"}}]};var j={directory:"isDirectory",file:"isFile"};function _(t){if(!Object.hasOwnProperty.call(j,t))throw new Error(`Invalid type specified: ${t}`)}var A=(t,e)=>e[j[t]](),R=t=>t instanceof URL?url.fileURLToPath(t):t;function b(t,{cwd:e=q__default.default.cwd(),type:r="file",allowSymlinks:m=!0}={}){_(r),e=R(e);let d=m?S__default.default.statSync:S__default.default.lstatSync;for(let c of t)try{let a=d(i__default.default.resolve(e,c),{throwIfNoEntry:!1});if(!a)continue;if(A(r,a))return c}catch{}}function v(t){return t instanceof URL?url.fileURLToPath(t):t}var z=Symbol("findUpStop");function Y(t,e={}){let r=i__default.default.resolve(v(e.cwd)??""),{root:m}=i__default.default.parse(r),d=i__default.default.resolve(r,v(e.stopAt)??m),c=e.limit??Number.POSITIVE_INFINITY,a=[t].flat(),N=n=>{if(typeof t!="function")return b(a,n);let h=t(n.cwd);return typeof h=="string"?b([h],n):h},y=[];for(;;){let n=N({...e,cwd:r});if(n===z||(n&&y.push(i__default.default.resolve(r,n)),r===d||y.length>=c))break;r=i__default.default.dirname(r);}return y}function u(t,e={}){return Y(t,{...e,limit:1})[0]}var T=u(["tailwind.config.ts","tailwind.config.js"]),Q=localPkg.getPackageInfoSync("tailwindcss")?.version,l=Q&&T?{extends:["plugin:tailwindcss/recommended"],settings:{tailwindcss:{callees:constants.tailwindFunctions,config:T}},rules:{"tailwindcss/classnames-order":["off"]}}:{extends:[],settings:void 0,rules:void 0};var E=u(["pnpm-workspace.yaml","pnpm-lock.yaml"]),$=E&&pathe.dirname(E),s={parserOptions:{EXPERIMENTAL_useProjectService:!0,tsconfigRootDir:$},plugins:["@typescript-eslint"],extends:["plugin:@typescript-eslint/strict-type-checked"],parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"@typescript-eslint/consistent-type-exports":["error"],"@typescript-eslint/consistent-type-imports":["error",{prefer:"type-imports",disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"@typescript-eslint/no-empty-interface":["error",{allowSingleExtends:!0}],"@typescript-eslint/no-explicit-any":["warn"],"@typescript-eslint/no-import-type-side-effects":["error"],"@typescript-eslint/no-misused-promises":"off"}};var k={extends:["plugin:unicorn/recommended"],rules:{"unicorn/filename-case":["off"],"unicorn/prefer-module":["off"],"unicorn/prevent-abbreviations":["off"],"unicorn/prefer-ternary":["error","only-single-line"],"unicorn/no-useless-undefined":["error",{checkArguments:!1}],"unicorn/prefer-top-level-await":["off"]}};var ot={root:!0,parserOptions:{sourceType:"module",cacheLifetime:{glob:"Infinity"},...s.parserOptions},plugins:[...s.plugins,...g.plugins],extends:["eslint:recommended","turbo","plugin:@tanstack/eslint-plugin-query/recommended",...x.extends,...I.extends,...l.extends,...k.extends,...s.extends,"plugin:@2digits/recommended",...p.extends,"prettier"],parser:s.parser,env:{es6:!0,node:!0},ignorePatterns:["node_modules","dist","build","coverage","public","tmp","tmp-build","!.prettierrc.js","templates"],settings:{...p.settings,...l.settings},rules:{...x.rules,...s.rules,...p.rules,...k.rules,...l.rules,"sort-imports":["off"],"max-params":["warn"]},overrides:[...g.overrides]};
18
18
 
19
- module.exports = Ze;
19
+ module.exports = ot;
20
20
  //# sourceMappingURL=out.js.map
21
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rules/next.ts","../src/rules/react.ts","../src/rules/storybook.ts","../../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js","../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js","../../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js","../../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js","../src/rules/tailwind.ts","../src/rules/typescript.ts","../src/rules/unicorn.ts","../src/index.ts"],"names":["getPackageInfoSync","nextVersion","next","reactVersion","react","storybook","path","process","fs","fsPromises","fileURLToPath","Node","value","Queue","#head","#tail","#size","node","current","typeMappings","checkType","type","matchType","stat","toPath","urlOrPath","locatePathSync","paths","cwd","allowSymlinks","statFunction","path_","findUpStop","findUpMultipleSync","name","options","directory","root","stopAt","limit","runMatcher","locateOptions","foundPath","matches","findUpSync","tailwindFunctions","tailwindConfig","tailwindVersion","tailwind","dirname","workspaceRoot","tsconfigRootDir","typescript","unicorn","src_default"],"mappings":"AAAA,OAAS,sBAAAA,MAA0B,YAInC,IAAMC,EAAcD,EAAmB,MAAM,GAAG,QAEnCE,EAAOD,EACH,CACX,QAAS,CAAC,MAAM,EAChB,MAAO,CACL,oCAAqC,KACvC,CACF,EACa,CACX,QAAS,CAAC,EACV,MAAO,MACT,EChBJ,OAAS,sBAAAD,MAA0B,YAInC,IAAMG,EAAeH,EAAmB,OAAO,GAAG,QAErCI,EAAQD,EACJ,CACX,QAAS,CAAC,2BAA4B,gCAAgC,EACtE,SAAU,CACR,MAAO,CACL,QAASA,CACX,CACF,EACA,MAAO,CACL,mBAAoB,CAAC,KAAK,EAC1B,2BAA4B,CAAC,KAAK,EAClC,0BAA2B,CAAC,KAAK,EACjC,oBAAqB,CACnB,QACA,CACE,QAAS,EACX,CACF,CACF,CACF,EACa,CACX,QAAS,CAAC,EACV,SAAU,OACV,MAAO,MACT,EC5BG,IAAME,EAAyB,CACpC,QAAS,CAAC,WAAW,EACrB,UAAW,CACT,CACE,MAAO,CAAC,oCAAoC,EAC5C,MAAO,CACL,qCAAsC,MACtC,+BAAgC,QAChC,qCAAsC,QACtC,4BAA6B,QAC7B,gCAAiC,OACjC,oCAAqC,OACrC,+BAAgC,OAChC,0BAA2B,QAC3B,iCAAkC,QAClC,0CAA2C,OAC7C,CACF,EACA,CACE,MAAO,CAAC,kCAAkC,EAC1C,MAAO,CACL,kCAAmC,OACrC,CACF,CACF,CACF,EC3BA,OAAOC,MAAU,OCAjB,OAAOC,MAAa,U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C,QAAS,kBAAkB,EACtD,+BAAgC,CAAC,QAAS,CAAE,eAAgB,EAAM,CAAC,EACnE,iCAAkC,CAAC,KAAK,CAC1C,CACF,ECJA,IAAOC,GAAqB,CAC1B,KAAM,GACN,cAAe,CACb,WAAY,SACZ,cAAe,CACb,KAAM,UACR,EAEA,GAAGF,EAAW,aAChB,EACA,QAAS,CAAC,GAAGA,EAAW,QAAS,GAAG/C,EAAU,OAAO,EACrD,QAAS,CACP,qBACA,QACA,mDAEA,GAAGH,EAAK,QAER,GAAG8C,EAAS,QAEZ,GAAGK,EAAQ,QAEX,GAAGD,EAAW,QAEd,8BAEA,GAAGhD,EAAM,QAET,UACF,EACA,OAAQgD,EAAW,OACnB,IAAK,CACH,IAAK,GACL,KAAM,EACR,EACA,eAAgB,CACd,eACA,OACA,QACA,WACA,SACA,MACA,YACA,kBACA,WACF,EACA,SAAU,CACR,GAAGhD,EAAM,SAET,GAAG4C,EAAS,QACd,EACA,MAAO,CACL,GAAGI,EAAW,MAEd,GAAGhD,EAAM,MAET,GAAGiD,EAAQ,MAEX,GAAGL,EAAS,MAEZ,eAAgB,CAAC,KAAK,EACtB,aAAc,CAAC,MAAM,CACvB,EACA,UAAW,CAAC,GAAG3C,EAAU,SAAS,CACpC","sourcesContent":["import { getPackageInfoSync } from 'local-pkg';\n\nimport { defineConfig } from '../utils';\n\nconst nextVersion = getPackageInfoSync('next')?.version;\n\nexport const next = nextVersion\n ? defineConfig({\n extends: ['next'],\n rules: {\n '@next/next/no-html-link-for-pages': 'off',\n },\n })\n : defineConfig({\n extends: [],\n rules: undefined,\n });\n","import { getPackageInfoSync } from 'local-pkg';\n\nimport { defineConfig } from '../utils';\n\nconst reactVersion = getPackageInfoSync('react')?.version;\n\nexport const react = reactVersion\n ? defineConfig({\n extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],\n settings: {\n react: {\n version: reactVersion,\n },\n },\n rules: {\n 'react/prop-types': ['off'],\n 'react/react-in-jsx-scope': ['off'],\n 'react/jsx-curly-newline': ['off'],\n 'react/jsx-newline': [\n 'error',\n {\n prevent: false,\n },\n ],\n },\n })\n : defineConfig({\n extends: [],\n settings: undefined,\n rules: undefined,\n });\n","import { defineConfig } from '../utils';\n\nexport const storybook = defineConfig({\n plugins: ['storybook'],\n overrides: [\n {\n files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],\n rules: {\n 'import/no-anonymous-default-export': 'off',\n 'storybook/await-interactions': 'error',\n 'storybook/context-in-play-function': 'error',\n 'storybook/default-exports': 'error',\n 'storybook/hierarchy-separator': 'warn',\n 'storybook/no-redundant-story-name': 'warn',\n 'storybook/prefer-pascal-case': 'warn',\n 'storybook/story-exports': 'error',\n 'storybook/use-storybook-expect': 'error',\n 'storybook/use-storybook-testing-library': 'error',\n },\n },\n {\n files: ['.storybook/main.@(js|cjs|mjs|ts)'],\n rules: {\n 'storybook/no-uninstalled-addons': 'error',\n },\n },\n ],\n});\n","import path from 'node:path';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n","import {fileURLToPath} from 'node:url';\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport * from './default.js';\n","import fs, {promises as fsPromises} from 'node:fs';\n\nexport async function pathExists(path) {\n\ttry {\n\t\tawait fsPromises.access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function pathExistsSync(path) {\n\ttry {\n\t\tfs.accessSync(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { findUpSync } from 'find-up';\nimport { getPackageInfoSync } from 'local-pkg';\n\nimport { tailwindFunctions } from '@2digits/constants';\n\nimport { defineConfig } from '../utils';\n\nconst tailwindConfig = findUpSync(['tailwind.config.ts', 'tailwind.config.js']);\n\nconst tailwindVersion = getPackageInfoSync('tailwindcss')?.version;\n\nexport const tailwind =\n tailwindVersion && tailwindConfig\n ? defineConfig({\n extends: ['plugin:tailwindcss/recommended'],\n settings: {\n tailwindcss: {\n callees: tailwindFunctions,\n config: tailwindConfig,\n },\n },\n rules: {\n 'tailwindcss/classnames-order': ['off'],\n },\n })\n : defineConfig({\n extends: [],\n settings: undefined,\n rules: undefined,\n });\n","import { findUpSync } from 'find-up';\nimport { dirname } from 'pathe';\n\nimport { defineConfig } from '../utils';\n\nconst workspaceRoot = findUpSync(['pnpm-workspace.yaml', 'pnpm-lock.yaml']);\n\nconst tsconfigRootDir = workspaceRoot && dirname(workspaceRoot);\n\nexport const typescript = defineConfig({\n parserOptions: {\n EXPERIMENTAL_useProjectService: true,\n tsconfigRootDir,\n },\n plugins: ['@typescript-eslint'],\n extends: ['plugin:@typescript-eslint/strict-type-checked'],\n parser: '@typescript-eslint/parser',\n rules: {\n '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],\n '@typescript-eslint/consistent-type-exports': ['error'],\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n disallowTypeAnnotations: false,\n fixStyle: 'inline-type-imports',\n },\n ],\n '@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],\n '@typescript-eslint/no-explicit-any': ['warn'],\n '@typescript-eslint/no-import-type-side-effects': ['error'],\n '@typescript-eslint/no-misused-promises': 'off',\n },\n});\n","import { defineConfig } from '../utils';\n\nexport const unicorn = defineConfig({\n extends: ['plugin:unicorn/recommended'],\n rules: {\n 'unicorn/filename-case': ['off'],\n 'unicorn/prefer-module': ['off'],\n 'unicorn/prevent-abbreviations': ['off'],\n 'unicorn/prefer-ternary': ['error', 'only-single-line'],\n 'unicorn/no-useless-undefined': ['error', { checkArguments: false }],\n 'unicorn/prefer-top-level-await': ['off'],\n },\n});\n","import { next } from './rules/next';\nimport { react } from './rules/react';\nimport { storybook } from './rules/storybook';\nimport { tailwind } from './rules/tailwind';\nimport { typescript } from './rules/typescript';\nimport { unicorn } from './rules/unicorn';\nimport { defineConfig } from './utils';\n\nexport default defineConfig({\n root: true,\n parserOptions: {\n sourceType: 'module',\n cacheLifetime: {\n glob: 'Infinity',\n },\n\n ...typescript.parserOptions,\n },\n plugins: [...typescript.plugins, ...storybook.plugins],\n extends: [\n 'eslint:recommended',\n 'turbo',\n 'plugin:@tanstack/eslint-plugin-query/recommended',\n\n ...next.extends,\n\n ...tailwind.extends,\n\n ...unicorn.extends,\n\n ...typescript.extends,\n\n 'plugin:@2digits/recommended',\n\n ...react.extends,\n\n 'prettier',\n ],\n parser: typescript.parser,\n env: {\n es6: true,\n node: true,\n },\n ignorePatterns: [\n 'node_modules',\n 'dist',\n 'build',\n 'coverage',\n 'public',\n 'tmp',\n 'tmp-build',\n '!.prettierrc.js',\n 'templates',\n ],\n settings: {\n ...react.settings,\n\n ...tailwind.settings,\n },\n rules: {\n ...typescript.rules,\n\n ...react.rules,\n\n ...unicorn.rules,\n\n ...tailwind.rules,\n\n 'sort-imports': ['off'],\n 'max-params': ['warn'],\n },\n overrides: [...storybook.overrides],\n});\n"]}
1
+ {"version":3,"sources":["../src/rules/jsdoc.ts","../src/rules/next.ts","../src/rules/react.ts","../src/rules/storybook.ts","../../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js","../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js","../../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js","../../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js","../src/rules/tailwind.ts","../src/rules/typescript.ts","../src/rules/unicorn.ts","../src/index.ts"],"names":["jsdoc","getPackageInfoSync","nextVersion","next","reactVersion","react","storybook","path","process","fs","fsPromises","fileURLToPath","Node","value","Queue","#head","#tail","#size","node","current","typeMappings","checkType","type","matchType","stat","toPath","urlOrPath","locatePathSync","paths","cwd","allowSymlinks","statFunction","path_","findUpStop","findUpMultipleSync","name","options","directory","root","stopAt","limit","runMatcher","locateOptions","foundPath","matches","findUpSync","tailwindFunctions","tailwindConfig","tailwindVersion","tailwind","dirname","workspaceRoot","tsconfigRootDir","typescript","unicorn","src_default"],"mappings":"AAEO,IAAMA,EAAqB,CAChC,QAAS,CAAC,2CAA2C,EACrD,MAAO,CACL,sBAAuB,CAAC,QAAS,CAAE,QAAS,CAAE,oBAAqB,EAAM,CAAE,CAAC,EAC5E,kBAAmB,CAAC,KAAK,CAC3B,CACF,ECRA,OAAS,sBAAAC,MAA0B,YAInC,IAAMC,EAAcD,EAAmB,MAAM,GAAG,QAEnCE,EAAOD,EACH,CACX,QAAS,CAAC,MAAM,EAChB,MAAO,CACL,oCAAqC,KACvC,CACF,EACa,CACX,QAAS,CAAC,EACV,MAAO,MACT,EChBJ,OAAS,sBAAAD,MAA0B,YAInC,IAAMG,EAAeH,EAAmB,OAAO,GAAG,QAErCI,EAAQD,EACJ,CACX,QAAS,CAAC,2BAA4B,gCAAgC,EACtE,SAAU,CACR,MAAO,CACL,QAASA,CACX,CACF,EACA,MAAO,CACL,mBAAoB,CAAC,KAAK,EAC1B,2BAA4B,CAAC,KAAK,EAClC,0BAA2B,CAAC,KAAK,EACjC,oBAAqB,CACnB,QACA,CACE,QAAS,EACX,CACF,CACF,CACF,EACa,CACX,QAAS,CAAC,EACV,SAAU,OACV,MAAO,MACT,EC5BG,IAAME,EAAyB,CACpC,QAAS,CAAC,WAAW,EACrB,UAAW,CACT,CACE,MAAO,CAAC,oCAAoC,EAC5C,MAAO,CACL,qCAAsC,MACtC,+BAAgC,QAChC,qCAAsC,QACtC,4BAA6B,QAC7B,gCAAiC,OACjC,oCAAqC,OACrC,+BAAgC,OAChC,0BAA2B,QAC3B,iCAAkC,QAClC,0CAA2C,OAC7C,CACF,EACA,CACE,MAAO,CAAC,kCAAkC,EAC1C,MAAO,CACL,kCAAmC,OACrC,CACF,CACF,CACF,EC3BA,OAAOC,MAAU,OCAjB,OAAOC,MAAa,UACpB,OAAOD,MAAU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EACtD,+BAAgC,CAAC,QAAS,CAAE,eAAgB,EAAM,CAAC,EACnE,iCAAkC,CAAC,KAAK,CAC1C,CACF,ECHA,IAAOC,GAAqB,CAC1B,KAAM,GACN,cAAe,CACb,WAAY,SACZ,cAAe,CACb,KAAM,UACR,EAEA,GAAGF,EAAW,aAChB,EACA,QAAS,CAAC,GAAGA,EAAW,QAAS,GAAG/C,EAAU,OAAO,EACrD,QAAS,CACP,qBACA,QACA,mDAEA,GAAGN,EAAM,QAET,GAAGG,EAAK,QAER,GAAG8C,EAAS,QAEZ,GAAGK,EAAQ,QAEX,GAAGD,EAAW,QAEd,8BAEA,GAAGhD,EAAM,QAET,UACF,EACA,OAAQgD,EAAW,OACnB,IAAK,CACH,IAAK,GACL,KAAM,EACR,EACA,eAAgB,CACd,eACA,OACA,QACA,WACA,SACA,MACA,YACA,kBACA,WACF,EACA,SAAU,CACR,GAAGhD,EAAM,SAET,GAAG4C,EAAS,QACd,EACA,MAAO,CACL,GAAGjD,EAAM,MAET,GAAGqD,EAAW,MAEd,GAAGhD,EAAM,MAET,GAAGiD,EAAQ,MAEX,GAAGL,EAAS,MAEZ,eAAgB,CAAC,KAAK,EACtB,aAAc,CAAC,MAAM,CACvB,EACA,UAAW,CAAC,GAAG3C,EAAU,SAAS,CACpC","sourcesContent":["import { defineConfig } from '../utils';\n\nexport const jsdoc = defineConfig({\n extends: ['plugin:jsdoc/recommended-typescript-error'],\n rules: {\n 'jsdoc/require-jsdoc': ['error', { require: { FunctionDeclaration: false } }],\n 'jsdoc/tag-lines': ['off'],\n },\n});\n","import { getPackageInfoSync } from 'local-pkg';\n\nimport { defineConfig } from '../utils';\n\nconst nextVersion = getPackageInfoSync('next')?.version;\n\nexport const next = nextVersion\n ? defineConfig({\n extends: ['next'],\n rules: {\n '@next/next/no-html-link-for-pages': 'off',\n },\n })\n : defineConfig({\n extends: [],\n rules: undefined,\n });\n","import { getPackageInfoSync } from 'local-pkg';\n\nimport { defineConfig } from '../utils';\n\nconst reactVersion = getPackageInfoSync('react')?.version;\n\nexport const react = reactVersion\n ? defineConfig({\n extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],\n settings: {\n react: {\n version: reactVersion,\n },\n },\n rules: {\n 'react/prop-types': ['off'],\n 'react/react-in-jsx-scope': ['off'],\n 'react/jsx-curly-newline': ['off'],\n 'react/jsx-newline': [\n 'error',\n {\n prevent: false,\n },\n ],\n },\n })\n : defineConfig({\n extends: [],\n settings: undefined,\n rules: undefined,\n });\n","import { defineConfig } from '../utils';\n\nexport const storybook = defineConfig({\n plugins: ['storybook'],\n overrides: [\n {\n files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],\n rules: {\n 'import/no-anonymous-default-export': 'off',\n 'storybook/await-interactions': 'error',\n 'storybook/context-in-play-function': 'error',\n 'storybook/default-exports': 'error',\n 'storybook/hierarchy-separator': 'warn',\n 'storybook/no-redundant-story-name': 'warn',\n 'storybook/prefer-pascal-case': 'warn',\n 'storybook/story-exports': 'error',\n 'storybook/use-storybook-expect': 'error',\n 'storybook/use-storybook-testing-library': 'error',\n },\n },\n {\n files: ['.storybook/main.@(js|cjs|mjs|ts)'],\n rules: {\n 'storybook/no-uninstalled-addons': 'error',\n },\n },\n ],\n});\n","import path from 'node:path';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n","import {fileURLToPath} from 'node:url';\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport * from './default.js';\n","import fs, {promises as fsPromises} from 'node:fs';\n\nexport async function pathExists(path) {\n\ttry {\n\t\tawait fsPromises.access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport function pathExistsSync(path) {\n\ttry {\n\t\tfs.accessSync(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { findUpSync } from 'find-up';\nimport { getPackageInfoSync } from 'local-pkg';\n\nimport { tailwindFunctions } from '@2digits/constants';\n\nimport { defineConfig } from '../utils';\n\nconst tailwindConfig = findUpSync(['tailwind.config.ts', 'tailwind.config.js']);\n\nconst tailwindVersion = getPackageInfoSync('tailwindcss')?.version;\n\nexport const tailwind =\n tailwindVersion && tailwindConfig\n ? defineConfig({\n extends: ['plugin:tailwindcss/recommended'],\n settings: {\n tailwindcss: {\n callees: tailwindFunctions,\n config: tailwindConfig,\n },\n },\n rules: {\n 'tailwindcss/classnames-order': ['off'],\n },\n })\n : defineConfig({\n extends: [],\n settings: undefined,\n rules: undefined,\n });\n","import { findUpSync } from 'find-up';\nimport { dirname } from 'pathe';\n\nimport { defineConfig } from '../utils';\n\nconst workspaceRoot = findUpSync(['pnpm-workspace.yaml', 'pnpm-lock.yaml']);\n\nconst tsconfigRootDir = workspaceRoot && dirname(workspaceRoot);\n\nexport const typescript = defineConfig({\n parserOptions: {\n EXPERIMENTAL_useProjectService: true,\n tsconfigRootDir,\n },\n plugins: ['@typescript-eslint'],\n extends: ['plugin:@typescript-eslint/strict-type-checked'],\n parser: '@typescript-eslint/parser',\n rules: {\n '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],\n '@typescript-eslint/consistent-type-exports': ['error'],\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n disallowTypeAnnotations: false,\n fixStyle: 'inline-type-imports',\n },\n ],\n '@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],\n '@typescript-eslint/no-explicit-any': ['warn'],\n '@typescript-eslint/no-import-type-side-effects': ['error'],\n '@typescript-eslint/no-misused-promises': 'off',\n },\n});\n","import { defineConfig } from '../utils';\n\nexport const unicorn = defineConfig({\n extends: ['plugin:unicorn/recommended'],\n rules: {\n 'unicorn/filename-case': ['off'],\n 'unicorn/prefer-module': ['off'],\n 'unicorn/prevent-abbreviations': ['off'],\n 'unicorn/prefer-ternary': ['error', 'only-single-line'],\n 'unicorn/no-useless-undefined': ['error', { checkArguments: false }],\n 'unicorn/prefer-top-level-await': ['off'],\n },\n});\n","import { jsdoc } from './rules/jsdoc';\nimport { next } from './rules/next';\nimport { react } from './rules/react';\nimport { storybook } from './rules/storybook';\nimport { tailwind } from './rules/tailwind';\nimport { typescript } from './rules/typescript';\nimport { unicorn } from './rules/unicorn';\nimport { defineConfig } from './utils';\n\nexport default defineConfig({\n root: true,\n parserOptions: {\n sourceType: 'module',\n cacheLifetime: {\n glob: 'Infinity',\n },\n\n ...typescript.parserOptions,\n },\n plugins: [...typescript.plugins, ...storybook.plugins],\n extends: [\n 'eslint:recommended',\n 'turbo',\n 'plugin:@tanstack/eslint-plugin-query/recommended',\n\n ...jsdoc.extends,\n\n ...next.extends,\n\n ...tailwind.extends,\n\n ...unicorn.extends,\n\n ...typescript.extends,\n\n 'plugin:@2digits/recommended',\n\n ...react.extends,\n\n 'prettier',\n ],\n parser: typescript.parser,\n env: {\n es6: true,\n node: true,\n },\n ignorePatterns: [\n 'node_modules',\n 'dist',\n 'build',\n 'coverage',\n 'public',\n 'tmp',\n 'tmp-build',\n '!.prettierrc.js',\n 'templates',\n ],\n settings: {\n ...react.settings,\n\n ...tailwind.settings,\n },\n rules: {\n ...jsdoc.rules,\n\n ...typescript.rules,\n\n ...react.rules,\n\n ...unicorn.rules,\n\n ...tailwind.rules,\n\n 'sort-imports': ['off'],\n 'max-params': ['warn'],\n },\n overrides: [...storybook.overrides],\n});\n"]}
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import { getPackageInfoSync } from 'local-pkg';
2
2
  import c from 'node:path';
3
3
  import F from 'node:process';
4
- import S from 'node:fs';
4
+ import j from 'node:fs';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { tailwindFunctions } from '@2digits/constants';
7
7
  import { dirname } from 'pathe';
8
8
 
9
- var C=getPackageInfoSync("next")?.version,I=C?{extends:["next"],rules:{"@next/next/no-html-link-for-pages":"off"}}:{extends:[],rules:void 0};var P=getPackageInfoSync("react")?.version,f=P?{extends:["plugin:react/recommended","plugin:react-hooks/recommended"],settings:{react:{version:P}},rules:{"react/prop-types":["off"],"react/react-in-jsx-scope":["off"],"react/jsx-curly-newline":["off"],"react/jsx-newline":["error",{prevent:!1}]}}:{extends:[],settings:void 0,rules:void 0};var g={plugins:["storybook"],overrides:[{files:["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"],rules:{"import/no-anonymous-default-export":"off","storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"warn","storybook/no-redundant-story-name":"warn","storybook/prefer-pascal-case":"warn","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error"}},{files:[".storybook/main.@(js|cjs|mjs|ts)"],rules:{"storybook/no-uninstalled-addons":"error"}}]};var T={directory:"isDirectory",file:"isFile"};function _(t){if(!Object.hasOwnProperty.call(T,t))throw new Error(`Invalid type specified: ${t}`)}var A=(t,e)=>e[T[t]](),R=t=>t instanceof URL?fileURLToPath(t):t;function b(t,{cwd:e=F.cwd(),type:r="file",allowSymlinks:d=!0}={}){_(r),e=R(e);let y=d?S.statSync:S.lstatSync;for(let a of t)try{let p=y(c.resolve(e,a),{throwIfNoEntry:!1});if(!p)continue;if(A(r,p))return a}catch{}}function v(t){return t instanceof URL?fileURLToPath(t):t}var z=Symbol("findUpStop");function Y(t,e={}){let r=c.resolve(v(e.cwd)??""),{root:d}=c.parse(r),y=c.resolve(r,v(e.stopAt)??d),a=e.limit??Number.POSITIVE_INFINITY,p=[t].flat(),j=s=>{if(typeof t!="function")return b(p,s);let x=t(s.cwd);return typeof x=="string"?b([x],s):x},h=[];for(;;){let s=j({...e,cwd:r});if(s===z||(s&&h.push(c.resolve(r,s)),r===y||h.length>=a))break;r=c.dirname(r);}return h}function l(t,e={}){return Y(t,{...e,limit:1})[0]}var E=l(["tailwind.config.ts","tailwind.config.js"]),Q=getPackageInfoSync("tailwindcss")?.version,m=Q&&E?{extends:["plugin:tailwindcss/recommended"],settings:{tailwindcss:{callees:tailwindFunctions,config:E}},rules:{"tailwindcss/classnames-order":["off"]}}:{extends:[],settings:void 0,rules:void 0};var N=l(["pnpm-workspace.yaml","pnpm-lock.yaml"]),$=N&&dirname(N),i={parserOptions:{EXPERIMENTAL_useProjectService:!0,tsconfigRootDir:$},plugins:["@typescript-eslint"],extends:["plugin:@typescript-eslint/strict-type-checked"],parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"@typescript-eslint/consistent-type-exports":["error"],"@typescript-eslint/consistent-type-imports":["error",{prefer:"type-imports",disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"@typescript-eslint/no-empty-interface":["error",{allowSingleExtends:!0}],"@typescript-eslint/no-explicit-any":["warn"],"@typescript-eslint/no-import-type-side-effects":["error"],"@typescript-eslint/no-misused-promises":"off"}};var k={extends:["plugin:unicorn/recommended"],rules:{"unicorn/filename-case":["off"],"unicorn/prefer-module":["off"],"unicorn/prevent-abbreviations":["off"],"unicorn/prefer-ternary":["error","only-single-line"],"unicorn/no-useless-undefined":["error",{checkArguments:!1}],"unicorn/prefer-top-level-await":["off"]}};var Ke={root:!0,parserOptions:{sourceType:"module",cacheLifetime:{glob:"Infinity"},...i.parserOptions},plugins:[...i.plugins,...g.plugins],extends:["eslint:recommended","turbo","plugin:@tanstack/eslint-plugin-query/recommended",...I.extends,...m.extends,...k.extends,...i.extends,"plugin:@2digits/recommended",...f.extends,"prettier"],parser:i.parser,env:{es6:!0,node:!0},ignorePatterns:["node_modules","dist","build","coverage","public","tmp","tmp-build","!.prettierrc.js","templates"],settings:{...f.settings,...m.settings},rules:{...i.rules,...f.rules,...k.rules,...m.rules,"sort-imports":["off"],"max-params":["warn"]},overrides:[...g.overrides]};
9
+ var g={extends:["plugin:jsdoc/recommended-typescript-error"],rules:{"jsdoc/require-jsdoc":["error",{require:{FunctionDeclaration:!1}}],"jsdoc/tag-lines":["off"]}};var L=getPackageInfoSync("next")?.version,P=L?{extends:["next"],rules:{"@next/next/no-html-link-for-pages":"off"}}:{extends:[],rules:void 0};var S=getPackageInfoSync("react")?.version,f=S?{extends:["plugin:react/recommended","plugin:react-hooks/recommended"],settings:{react:{version:S}},rules:{"react/prop-types":["off"],"react/react-in-jsx-scope":["off"],"react/jsx-curly-newline":["off"],"react/jsx-newline":["error",{prevent:!1}]}}:{extends:[],settings:void 0,rules:void 0};var w={plugins:["storybook"],overrides:[{files:["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"],rules:{"import/no-anonymous-default-export":"off","storybook/await-interactions":"error","storybook/context-in-play-function":"error","storybook/default-exports":"error","storybook/hierarchy-separator":"warn","storybook/no-redundant-story-name":"warn","storybook/prefer-pascal-case":"warn","storybook/story-exports":"error","storybook/use-storybook-expect":"error","storybook/use-storybook-testing-library":"error"}},{files:[".storybook/main.@(js|cjs|mjs|ts)"],rules:{"storybook/no-uninstalled-addons":"error"}}]};var T={directory:"isDirectory",file:"isFile"};function A(t){if(!Object.hasOwnProperty.call(T,t))throw new Error(`Invalid type specified: ${t}`)}var R=(t,e)=>e[T[t]](),M=t=>t instanceof URL?fileURLToPath(t):t;function v(t,{cwd:e=F.cwd(),type:r="file",allowSymlinks:d=!0}={}){A(r),e=M(e);let y=d?j.statSync:j.lstatSync;for(let a of t)try{let p=y(c.resolve(e,a),{throwIfNoEntry:!1});if(!p)continue;if(R(r,p))return a}catch{}}function k(t){return t instanceof URL?fileURLToPath(t):t}var Y=Symbol("findUpStop");function D(t,e={}){let r=c.resolve(k(e.cwd)??""),{root:d}=c.parse(r),y=c.resolve(r,k(e.stopAt)??d),a=e.limit??Number.POSITIVE_INFINITY,p=[t].flat(),C=s=>{if(typeof t!="function")return v(p,s);let x=t(s.cwd);return typeof x=="string"?v([x],s):x},h=[];for(;;){let s=C({...e,cwd:r});if(s===Y||(s&&h.push(c.resolve(r,s)),r===y||h.length>=a))break;r=c.dirname(r);}return h}function l(t,e={}){return D(t,{...e,limit:1})[0]}var E=l(["tailwind.config.ts","tailwind.config.js"]),X=getPackageInfoSync("tailwindcss")?.version,m=X&&E?{extends:["plugin:tailwindcss/recommended"],settings:{tailwindcss:{callees:tailwindFunctions,config:E}},rules:{"tailwindcss/classnames-order":["off"]}}:{extends:[],settings:void 0,rules:void 0};var N=l(["pnpm-workspace.yaml","pnpm-lock.yaml"]),B=N&&dirname(N),i={parserOptions:{EXPERIMENTAL_useProjectService:!0,tsconfigRootDir:B},plugins:["@typescript-eslint"],extends:["plugin:@typescript-eslint/strict-type-checked"],parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/ban-ts-comment":["error",{"ts-ignore":"allow-with-description"}],"@typescript-eslint/consistent-type-exports":["error"],"@typescript-eslint/consistent-type-imports":["error",{prefer:"type-imports",disallowTypeAnnotations:!1,fixStyle:"inline-type-imports"}],"@typescript-eslint/no-empty-interface":["error",{allowSingleExtends:!0}],"@typescript-eslint/no-explicit-any":["warn"],"@typescript-eslint/no-import-type-side-effects":["error"],"@typescript-eslint/no-misused-promises":"off"}};var I={extends:["plugin:unicorn/recommended"],rules:{"unicorn/filename-case":["off"],"unicorn/prefer-module":["off"],"unicorn/prevent-abbreviations":["off"],"unicorn/prefer-ternary":["error","only-single-line"],"unicorn/no-useless-undefined":["error",{checkArguments:!1}],"unicorn/prefer-top-level-await":["off"]}};var tt={root:!0,parserOptions:{sourceType:"module",cacheLifetime:{glob:"Infinity"},...i.parserOptions},plugins:[...i.plugins,...w.plugins],extends:["eslint:recommended","turbo","plugin:@tanstack/eslint-plugin-query/recommended",...g.extends,...P.extends,...m.extends,...I.extends,...i.extends,"plugin:@2digits/recommended",...f.extends,"prettier"],parser:i.parser,env:{es6:!0,node:!0},ignorePatterns:["node_modules","dist","build","coverage","public","tmp","tmp-build","!.prettierrc.js","templates"],settings:{...f.settings,...m.settings},rules:{...g.rules,...i.rules,...f.rules,...I.rules,...m.rules,"sort-imports":["off"],"max-params":["warn"]},overrides:[...w.overrides]};
10
10
 
11
- export { Ke as default };
11
+ export { tt as default };
12
12
  //# sourceMappingURL=out.js.map
13
13
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rules/next.ts","../src/rules/react.ts","../src/rules/storybook.ts","../../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js","../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js","../../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js","../src/rules/tailwind.ts","../src/rules/typescript.ts","../src/rules/unicorn.ts","../src/index.ts"],"names":["getPackageInfoSync","nextVersion","next","reactVersion","react","storybook","path","process","fs","fsPromises","fileURLToPath","Node","value","Queue","#head","#tail","#size","node","current","typeMappings","checkType","type","matchType","stat","toPath","urlOrPath","locatePathSync","paths","cwd","allowSymlinks","statFunction","path_","findUpStop","findUpMultipleSync","name","options","directory","root","stopAt","limit","runMatcher","locateOptions","foundPath","matches","findUpSync","tailwindFunctions","tailwindConfig","tailwindVersion","tailwind","dirname","workspaceRoot","tsconfigRootDir","typescript","unicorn","src_default"],"mappings":"AAAA,OAAS,sBAAAA,MAA0B,YAInC,IAAMC,EAAcD,EAAmB,MAAM,GAAG,QAEnCE,EAAOD,EACH,CACX,QAAS,CAAC,MAAM,EAChB,MAAO,CACL,oCAAqC,KACvC,CACF,EACa,CACX,QAAS,CAAC,EACV,MAAO,MACT,EChBJ,OAAS,sBAAAD,MAA0B,YAInC,IAAMG,EAAeH,EAAmB,OAAO,GAAG,QAErCI,EAAQD,EACJ,CACX,QAAS,CAAC,2BAA4B,gCAAgC,EACtE,SAAU,CACR,MAAO,CACL,QAASA,CACX,CACF,EACA,MAAO,CACL,mBAAoB,CAAC,KAAK,EAC1B,2BAA4B,CAAC,KAAK,EAClC,0BAA2B,CAAC,KAAK,EACjC,oBAAqB,CACnB,QACA,CACE,QAAS,EACX,CACF,CACF,CACF,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CAA8C,CAAC,OAAO,EACtD,6CAA8C,CAC5C,QACA,CACE,OAAQ,eACR,wBAAyB,GACzB,SAAU,qBACZ,CACF,EACA,wCAAyC,CAAC,QAAS,CAAE,mBAAoB,EAAK,CAAC,EAC/E,qCAAsC,CAAC,MAAM,EAC7C,iDAAkD,CAAC,OAAO,EAC1D,yCAA0C,KAC5C,CACF,EC/BO,IAAME,EAAuB,CAClC,QAAS,CAAC,4BAA4B,EACtC,MAAO,CACL,wBAAyB,CAAC,KAAK,EAC/B,wBAAyB,CAAC,KAAK,EAC/B,gCAAiC,CAAC,KAAK,EACvC,yBAA0B,CAAC,QAAS,kBAAkB,EACtD,+BAAgC,CAAC,QAAS,CAAE,eAAgB,EAAM,CAAC,EACnE,iCAAkC,CAAC,KAAK,CAC1C,CACF,ECJA,IAAOC,GAAqB,CAC1B,KAAM,GACN,cAAe,CACb,WAAY,SACZ,cAAe,CACb,KAAM,UACR,EAEA,GAAGF,EAAW,aAChB,EACA,QAAS,CAAC,GAAGA,EAAW,QAAS,GAAG/C,EAAU,OAAO,EACrD,QAAS,CACP,qBACA,QACA,mDAEA,GAAGH,EAAK,QAER,GAAG8C,EAAS,QAEZ,GAAGK,EAAQ,QAEX,GAAGD,EAAW,QAEd,8BAEA,GAAGhD,EAAM,QAET,UACF,EACA,OAAQgD,EAAW,OACnB,IAAK,CACH,IAAK,GACL,KAAM,EACR,EACA,eAAgB,CACd,eACA,OACA,QACA,WACA,SACA,MACA,YACA,kBACA,WACF,EACA,SAAU,CACR,GAAGhD,EAAM,SAET,GAAG4C,EAAS,QACd,EACA,MAAO,CACL,GAAGI,EAAW,MAEd,GAAGhD,EAAM,MAET,GAAGiD,EAAQ,MAEX,GAAGL,EAAS,MAEZ,eAAgB,CAAC,KAAK,EACtB,aAAc,CAAC,MAAM,CACvB,EACA,UAAW,CAAC,GAAG3C,EAAU,SAAS,CACpC","sourcesContent":["import { getPackageInfoSync } from 'local-pkg';\n\nimport { defineConfig } from '../utils';\n\nconst nextVersion = getPackageInfoSync('next')?.version;\n\nexport const next = nextVersion\n ? defineConfig({\n extends: ['next'],\n rules: {\n '@next/next/no-html-link-for-pages': 'off',\n },\n })\n : defineConfig({\n extends: [],\n rules: undefined,\n });\n","import { getPackageInfoSync } from 'local-pkg';\n\nimport { defineConfig } from '../utils';\n\nconst reactVersion = getPackageInfoSync('react')?.version;\n\nexport const react = reactVersion\n ? defineConfig({\n extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],\n settings: {\n react: {\n version: reactVersion,\n },\n },\n rules: {\n 'react/prop-types': ['off'],\n 'react/react-in-jsx-scope': ['off'],\n 'react/jsx-curly-newline': ['off'],\n 'react/jsx-newline': [\n 'error',\n {\n prevent: false,\n },\n ],\n },\n })\n : defineConfig({\n extends: [],\n settings: undefined,\n rules: undefined,\n });\n","import { defineConfig } from '../utils';\n\nexport const storybook = defineConfig({\n plugins: ['storybook'],\n overrides: [\n {\n files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],\n rules: {\n 'import/no-anonymous-default-export': 'off',\n 'storybook/await-interactions': 'error',\n 'storybook/context-in-play-function': 'error',\n 'storybook/default-exports': 'error',\n 'storybook/hierarchy-separator': 'warn',\n 'storybook/no-redundant-story-name': 'warn',\n 'storybook/prefer-pascal-case': 'warn',\n 'storybook/story-exports': 'error',\n 'storybook/use-storybook-expect': 'error',\n 'storybook/use-storybook-testing-library': 'error',\n },\n },\n {\n files: ['.storybook/main.@(js|cjs|mjs|ts)'],\n rules: {\n 'storybook/no-uninstalled-addons': 'error',\n },\n },\n ],\n});\n","import path from 'node:path';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n","import {fileURLToPath} from 'node:url';\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport * from './default.js';\n","import { findUpSync } from 'find-up';\nimport { getPackageInfoSync } from 'local-pkg';\n\nimport { tailwindFunctions } from '@2digits/constants';\n\nimport { defineConfig } from '../utils';\n\nconst tailwindConfig = findUpSync(['tailwind.config.ts', 'tailwind.config.js']);\n\nconst tailwindVersion = getPackageInfoSync('tailwindcss')?.version;\n\nexport const tailwind =\n tailwindVersion && tailwindConfig\n ? defineConfig({\n extends: ['plugin:tailwindcss/recommended'],\n settings: {\n tailwindcss: {\n callees: tailwindFunctions,\n config: tailwindConfig,\n },\n },\n rules: {\n 'tailwindcss/classnames-order': ['off'],\n },\n })\n : defineConfig({\n extends: [],\n settings: undefined,\n rules: undefined,\n });\n","import { findUpSync } from 'find-up';\nimport { dirname } from 'pathe';\n\nimport { defineConfig } from '../utils';\n\nconst workspaceRoot = findUpSync(['pnpm-workspace.yaml', 'pnpm-lock.yaml']);\n\nconst tsconfigRootDir = workspaceRoot && dirname(workspaceRoot);\n\nexport const typescript = defineConfig({\n parserOptions: {\n EXPERIMENTAL_useProjectService: true,\n tsconfigRootDir,\n },\n plugins: ['@typescript-eslint'],\n extends: ['plugin:@typescript-eslint/strict-type-checked'],\n parser: '@typescript-eslint/parser',\n rules: {\n '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],\n '@typescript-eslint/consistent-type-exports': ['error'],\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n disallowTypeAnnotations: false,\n fixStyle: 'inline-type-imports',\n },\n ],\n '@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],\n '@typescript-eslint/no-explicit-any': ['warn'],\n '@typescript-eslint/no-import-type-side-effects': ['error'],\n '@typescript-eslint/no-misused-promises': 'off',\n },\n});\n","import { defineConfig } from '../utils';\n\nexport const unicorn = defineConfig({\n extends: ['plugin:unicorn/recommended'],\n rules: {\n 'unicorn/filename-case': ['off'],\n 'unicorn/prefer-module': ['off'],\n 'unicorn/prevent-abbreviations': ['off'],\n 'unicorn/prefer-ternary': ['error', 'only-single-line'],\n 'unicorn/no-useless-undefined': ['error', { checkArguments: false }],\n 'unicorn/prefer-top-level-await': ['off'],\n },\n});\n","import { next } from './rules/next';\nimport { react } from './rules/react';\nimport { storybook } from './rules/storybook';\nimport { tailwind } from './rules/tailwind';\nimport { typescript } from './rules/typescript';\nimport { unicorn } from './rules/unicorn';\nimport { defineConfig } from './utils';\n\nexport default defineConfig({\n root: true,\n parserOptions: {\n sourceType: 'module',\n cacheLifetime: {\n glob: 'Infinity',\n },\n\n ...typescript.parserOptions,\n },\n plugins: [...typescript.plugins, ...storybook.plugins],\n extends: [\n 'eslint:recommended',\n 'turbo',\n 'plugin:@tanstack/eslint-plugin-query/recommended',\n\n ...next.extends,\n\n ...tailwind.extends,\n\n ...unicorn.extends,\n\n ...typescript.extends,\n\n 'plugin:@2digits/recommended',\n\n ...react.extends,\n\n 'prettier',\n ],\n parser: typescript.parser,\n env: {\n es6: true,\n node: true,\n },\n ignorePatterns: [\n 'node_modules',\n 'dist',\n 'build',\n 'coverage',\n 'public',\n 'tmp',\n 'tmp-build',\n '!.prettierrc.js',\n 'templates',\n ],\n settings: {\n ...react.settings,\n\n ...tailwind.settings,\n },\n rules: {\n ...typescript.rules,\n\n ...react.rules,\n\n ...unicorn.rules,\n\n ...tailwind.rules,\n\n 'sort-imports': ['off'],\n 'max-params': ['warn'],\n },\n overrides: [...storybook.overrides],\n});\n"]}
1
+ {"version":3,"sources":["../src/rules/jsdoc.ts","../src/rules/next.ts","../src/rules/react.ts","../src/rules/storybook.ts","../../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js","../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js","../../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js","../src/rules/tailwind.ts","../src/rules/typescript.ts","../src/rules/unicorn.ts","../src/index.ts"],"names":["jsdoc","getPackageInfoSync","nextVersion","next","reactVersion","react","storybook","path","process","fs","fsPromises","fileURLToPath","Node","value","Queue","#head","#tail","#size","node","current","typeMappings","checkType","type","matchType","stat","toPath","urlOrPath","locatePathSync","paths","cwd","allowSymlinks","statFunction","path_","findUpStop","findUpMultipleSync","name","options","directory","root","stopAt","limit","runMatcher","locateOptions","foundPath","matches","findUpSync","tailwindFunctions","tailwindConfig","tailwindVersion","tailwind","dirname","workspaceRoot","tsconfigRootDir","typescript","unicorn","src_default"],"mappings":"AAEO,IAAMA,EAAqB,CAChC,QAAS,CAAC,2CAA2C,EACrD,MAAO,CACL,sBAAuB,CAAC,QAAS,CAAE,QAAS,CAAE,oBAAqB,EAAM,CAAE,CAAC,EAC5E,kBAAmB,CAAC,KAAK,CAC3B,CACF,ECRA,OAAS,sBAAAC,MAA0B,YAInC,IAAMC,EAAcD,EAAmB,MAAM,GAAG,QAEnCE,EAAOD,EACH,CACX,QAAS,CAAC,MAAM,EAChB,MAAO,CACL,oCAAqC,KACvC,CACF,EACa,CACX,QAAS,CAAC,EACV,MAAO,MACT,EChBJ,OAAS,sBAAAD,MAA0B,YAInC,IAAMG,EAAeH,EAAmB,OAAO,GAAG,QAErCI,EAAQD,EACJ,CACX,QAAS,CAAC,2BAA4B,gCAAgC,EACtE,SAAU,CACR,MAAO,CACL,QAASA,CACX,CACF,EACA,MAAO,CACL,mBAAoB,CAAC,KAAK,EAC1B,2BAA4B,CAAC,KAAK,EAClC,0BAA2B,CAAC,KAAK,EACjC,oBAAqB,CACnB,QACA,CACE,QAAS,EACX,CACF,CACF,CACF,EACa,CACX,QAAS,CAAC,EACV,SAAU,OACV,MAAO,MACT,EC5BG,IAAME,EAAyB,CACpC,QAAS,CAAC,WAAW,EACrB,UAAW,CACT,CACE,MAAO,CAAC,oCAAoC,EAC5C,MAAO,CACL,qCAAsC,MACtC,+BAAgC,QAChC,qCAAsC,QACtC,4BAA6B,QAC7B,gCAAiC,OACjC,oCAAqC,OACrC,+BAAgC,OAChC,0BAA2B,QAC3B,iCAAkC,QAClC,0CAA2C,OAC7C,CACF,EACA,CACE,M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C/B,wBAAyB,CAAC,KAAK,EAC/B,gCAAiC,CAAC,KAAK,EACvC,yBAA0B,CAAC,QAAS,kBAAkB,EACtD,+BAAgC,CAAC,QAAS,CAAE,eAAgB,EAAM,CAAC,EACnE,iCAAkC,CAAC,KAAK,CAC1C,CACF,ECHA,IAAOC,GAAqB,CAC1B,KAAM,GACN,cAAe,CACb,WAAY,SACZ,cAAe,CACb,KAAM,UACR,EAEA,GAAGF,EAAW,aAChB,EACA,QAAS,CAAC,GAAGA,EAAW,QAAS,GAAG/C,EAAU,OAAO,EACrD,QAAS,CACP,qBACA,QACA,mDAEA,GAAGN,EAAM,QAET,GAAGG,EAAK,QAER,GAAG8C,EAAS,QAEZ,GAAGK,EAAQ,QAEX,GAAGD,EAAW,QAEd,8BAEA,GAAGhD,EAAM,QAET,UACF,EACA,OAAQgD,EAAW,OACnB,IAAK,CACH,IAAK,GACL,KAAM,EACR,EACA,eAAgB,CACd,eACA,OACA,QACA,WACA,SACA,MACA,YACA,kBACA,WACF,EACA,SAAU,CACR,GAAGhD,EAAM,SAET,GAAG4C,EAAS,QACd,EACA,MAAO,CACL,GAAGjD,EAAM,MAET,GAAGqD,EAAW,MAEd,GAAGhD,EAAM,MAET,GAAGiD,EAAQ,MAEX,GAAGL,EAAS,MAEZ,eAAgB,CAAC,KAAK,EACtB,aAAc,CAAC,MAAM,CACvB,EACA,UAAW,CAAC,GAAG3C,EAAU,SAAS,CACpC","sourcesContent":["import { defineConfig } from '../utils';\n\nexport const jsdoc = defineConfig({\n extends: ['plugin:jsdoc/recommended-typescript-error'],\n rules: {\n 'jsdoc/require-jsdoc': ['error', { require: { FunctionDeclaration: false } }],\n 'jsdoc/tag-lines': ['off'],\n },\n});\n","import { getPackageInfoSync } from 'local-pkg';\n\nimport { defineConfig } from '../utils';\n\nconst nextVersion = getPackageInfoSync('next')?.version;\n\nexport const next = nextVersion\n ? defineConfig({\n extends: ['next'],\n rules: {\n '@next/next/no-html-link-for-pages': 'off',\n },\n })\n : defineConfig({\n extends: [],\n rules: undefined,\n });\n","import { getPackageInfoSync } from 'local-pkg';\n\nimport { defineConfig } from '../utils';\n\nconst reactVersion = getPackageInfoSync('react')?.version;\n\nexport const react = reactVersion\n ? defineConfig({\n extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],\n settings: {\n react: {\n version: reactVersion,\n },\n },\n rules: {\n 'react/prop-types': ['off'],\n 'react/react-in-jsx-scope': ['off'],\n 'react/jsx-curly-newline': ['off'],\n 'react/jsx-newline': [\n 'error',\n {\n prevent: false,\n },\n ],\n },\n })\n : defineConfig({\n extends: [],\n settings: undefined,\n rules: undefined,\n });\n","import { defineConfig } from '../utils';\n\nexport const storybook = defineConfig({\n plugins: ['storybook'],\n overrides: [\n {\n files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],\n rules: {\n 'import/no-anonymous-default-export': 'off',\n 'storybook/await-interactions': 'error',\n 'storybook/context-in-play-function': 'error',\n 'storybook/default-exports': 'error',\n 'storybook/hierarchy-separator': 'warn',\n 'storybook/no-redundant-story-name': 'warn',\n 'storybook/prefer-pascal-case': 'warn',\n 'storybook/story-exports': 'error',\n 'storybook/use-storybook-expect': 'error',\n 'storybook/use-storybook-testing-library': 'error',\n },\n },\n {\n files: ['.storybook/main.@(js|cjs|mjs|ts)'],\n rules: {\n 'storybook/no-uninstalled-addons': 'error',\n },\n },\n ],\n});\n","import path from 'node:path';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n","import {fileURLToPath} from 'node:url';\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport * from './default.js';\n","import { findUpSync } from 'find-up';\nimport { getPackageInfoSync } from 'local-pkg';\n\nimport { tailwindFunctions } from '@2digits/constants';\n\nimport { defineConfig } from '../utils';\n\nconst tailwindConfig = findUpSync(['tailwind.config.ts', 'tailwind.config.js']);\n\nconst tailwindVersion = getPackageInfoSync('tailwindcss')?.version;\n\nexport const tailwind =\n tailwindVersion && tailwindConfig\n ? defineConfig({\n extends: ['plugin:tailwindcss/recommended'],\n settings: {\n tailwindcss: {\n callees: tailwindFunctions,\n config: tailwindConfig,\n },\n },\n rules: {\n 'tailwindcss/classnames-order': ['off'],\n },\n })\n : defineConfig({\n extends: [],\n settings: undefined,\n rules: undefined,\n });\n","import { findUpSync } from 'find-up';\nimport { dirname } from 'pathe';\n\nimport { defineConfig } from '../utils';\n\nconst workspaceRoot = findUpSync(['pnpm-workspace.yaml', 'pnpm-lock.yaml']);\n\nconst tsconfigRootDir = workspaceRoot && dirname(workspaceRoot);\n\nexport const typescript = defineConfig({\n parserOptions: {\n EXPERIMENTAL_useProjectService: true,\n tsconfigRootDir,\n },\n plugins: ['@typescript-eslint'],\n extends: ['plugin:@typescript-eslint/strict-type-checked'],\n parser: '@typescript-eslint/parser',\n rules: {\n '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],\n '@typescript-eslint/consistent-type-exports': ['error'],\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n disallowTypeAnnotations: false,\n fixStyle: 'inline-type-imports',\n },\n ],\n '@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],\n '@typescript-eslint/no-explicit-any': ['warn'],\n '@typescript-eslint/no-import-type-side-effects': ['error'],\n '@typescript-eslint/no-misused-promises': 'off',\n },\n});\n","import { defineConfig } from '../utils';\n\nexport const unicorn = defineConfig({\n extends: ['plugin:unicorn/recommended'],\n rules: {\n 'unicorn/filename-case': ['off'],\n 'unicorn/prefer-module': ['off'],\n 'unicorn/prevent-abbreviations': ['off'],\n 'unicorn/prefer-ternary': ['error', 'only-single-line'],\n 'unicorn/no-useless-undefined': ['error', { checkArguments: false }],\n 'unicorn/prefer-top-level-await': ['off'],\n },\n});\n","import { jsdoc } from './rules/jsdoc';\nimport { next } from './rules/next';\nimport { react } from './rules/react';\nimport { storybook } from './rules/storybook';\nimport { tailwind } from './rules/tailwind';\nimport { typescript } from './rules/typescript';\nimport { unicorn } from './rules/unicorn';\nimport { defineConfig } from './utils';\n\nexport default defineConfig({\n root: true,\n parserOptions: {\n sourceType: 'module',\n cacheLifetime: {\n glob: 'Infinity',\n },\n\n ...typescript.parserOptions,\n },\n plugins: [...typescript.plugins, ...storybook.plugins],\n extends: [\n 'eslint:recommended',\n 'turbo',\n 'plugin:@tanstack/eslint-plugin-query/recommended',\n\n ...jsdoc.extends,\n\n ...next.extends,\n\n ...tailwind.extends,\n\n ...unicorn.extends,\n\n ...typescript.extends,\n\n 'plugin:@2digits/recommended',\n\n ...react.extends,\n\n 'prettier',\n ],\n parser: typescript.parser,\n env: {\n es6: true,\n node: true,\n },\n ignorePatterns: [\n 'node_modules',\n 'dist',\n 'build',\n 'coverage',\n 'public',\n 'tmp',\n 'tmp-build',\n '!.prettierrc.js',\n 'templates',\n ],\n settings: {\n ...react.settings,\n\n ...tailwind.settings,\n },\n rules: {\n ...jsdoc.rules,\n\n ...typescript.rules,\n\n ...react.rules,\n\n ...unicorn.rules,\n\n ...tailwind.rules,\n\n 'sort-imports': ['off'],\n 'max-params': ['warn'],\n },\n overrides: [...storybook.overrides],\n});\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@2digits/eslint-config",
3
3
  "description": "Effortlessly enforce best practices and catch errors with this comprehensive ESLint configuration for TypeScript, featuring popular plugins like @typescript-eslint, eslint-plugin-react, and eslint-plugin-unicorn.",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "license": "MIT",
6
6
  "public": true,
7
7
  "sideEffects": false,
@@ -28,33 +28,35 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@2digits/constants": "*",
32
- "@2digits/eslint-plugin": "*",
33
- "@tanstack/eslint-plugin-query": "^5.14.6",
34
- "@types/eslint": "^8.56.0",
35
- "@typescript-eslint/eslint-plugin": "^6.16.0",
36
- "@typescript-eslint/parser": "^6.16.0",
37
- "eslint-config-next": "^14.0.4",
31
+ "@2digits/constants": "0.1.3",
32
+ "@2digits/eslint-plugin": "1.0.4",
33
+ "@tanstack/eslint-plugin-query": "^5.18.1",
34
+ "@types/eslint": "^8.56.2",
35
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
36
+ "@typescript-eslint/parser": "^6.21.0",
37
+ "eslint-config-next": "^14.1.0",
38
38
  "eslint-config-prettier": "^9.1.0",
39
- "eslint-config-turbo": "^1.11.2",
39
+ "eslint-config-turbo": "^1.12.2",
40
+ "eslint-plugin-jsdoc": "^48.0.5",
40
41
  "eslint-plugin-react": "^7.33.2",
41
42
  "eslint-plugin-react-hooks": "^4.6.0",
42
43
  "eslint-plugin-storybook": "^0.6.15",
43
- "eslint-plugin-tailwindcss": "^3.13.0",
44
- "eslint-plugin-unicorn": "^50.0.1",
44
+ "eslint-plugin-tailwindcss": "^3.14.2",
45
+ "eslint-plugin-unicorn": "^51.0.0",
45
46
  "find-up": "^7.0.0",
46
47
  "local-pkg": "^0.5.0",
47
- "pathe": "^1.1.1"
48
+ "pathe": "^1.1.2"
48
49
  },
49
50
  "devDependencies": {
50
- "@2digits/tsconfig": "*",
51
- "@eslint-types/prettier": "5.0.1-1",
52
- "@eslint-types/typescript-eslint": "^6.12.0",
53
- "@eslint-types/unicorn": "^49.0.0",
51
+ "@2digits/tsconfig": "0.3.4",
52
+ "@eslint-types/jsdoc": "^48.0.4",
53
+ "@eslint-types/prettier": "5.1.3",
54
+ "@eslint-types/typescript-eslint": "^6.19.1",
55
+ "@eslint-types/unicorn": "^50.0.1",
54
56
  "eslint": "^8.56.0",
55
- "eslint-define-config": "^2.0.0",
57
+ "eslint-define-config": "^2.1.0",
56
58
  "tsup": "^8.0.1",
57
- "turbo": "^1.11.2",
59
+ "turbo": "^1.12.2",
58
60
  "typescript": "^5.3.3"
59
61
  },
60
62
  "eslintConfig": {