@2digits/eslint-config 1.3.1 → 1.5.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
@@ -58,6 +58,10 @@ 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 '@typescript-eslint/no-confusing-void-expression': ["error", {
62
+ readonly ignoreArrowShorthand: true;
63
+ readonly ignoreVoidOperator: true;
64
+ }];
61
65
  readonly 'jsdoc/require-jsdoc': ["error", {
62
66
  readonly require: {
63
67
  readonly FunctionDeclaration: false;
package/dist/index.d.ts CHANGED
@@ -58,6 +58,10 @@ 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 '@typescript-eslint/no-confusing-void-expression': ["error", {
62
+ readonly ignoreArrowShorthand: true;
63
+ readonly ignoreVoidOperator: true;
64
+ }];
61
65
  readonly 'jsdoc/require-jsdoc': ["error", {
62
66
  readonly require: {
63
67
  readonly FunctionDeclaration: false;
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var i__default = /*#__PURE__*/_interopDefault(i);
14
14
  var U__default = /*#__PURE__*/_interopDefault(U);
15
15
  var I__default = /*#__PURE__*/_interopDefault(I);
16
16
 
17
- var h={extends:["plugin:jsdoc/recommended-typescript-error"],rules:{"jsdoc/require-jsdoc":["error",{require:{FunctionDeclaration:!1}}],"jsdoc/tag-lines":["off"]}};var N=localPkg.getPackageInfoSync("next")?.version,v=N?{extends:["next"],rules:{"@next/next/no-html-link-for-pages":"off"}}:{extends:[],rules:void 0};var k=localPkg.getPackageInfoSync("react")?.version,p=k?{extends:["plugin:react/recommended","plugin:react-hooks/recommended"],settings:{react:{version:k}},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 P={directory:"isDirectory",file:"isFile"};function F(e){if(!Object.hasOwnProperty.call(P,e))throw new Error(`Invalid type specified: ${e}`)}var V=(e,r)=>r[P[e]](),_=e=>e instanceof URL?url.fileURLToPath(e):e;function g(e,{cwd:r=U__default.default.cwd(),type:o="file",allowSymlinks:l=!0}={}){F(o),r=_(r);let m=l?I__default.default.statSync:I__default.default.lstatSync;for(let c of e)try{let a=m(i__default.default.resolve(r,c),{throwIfNoEntry:!1});if(!a)continue;if(V(o,a))return c}catch{}}function w(e){return e instanceof URL?url.fileURLToPath(e):e}var R=Symbol("findUpStop");function M(e,r={}){let o=i__default.default.resolve(w(r.cwd)??""),{root:l}=i__default.default.parse(o),m=i__default.default.resolve(o,w(r.stopAt)??l),c=r.limit??Number.POSITIVE_INFINITY,a=[e].flat(),T=n=>{if(typeof e!="function")return g(a,n);let y=e(n.cwd);return typeof y=="string"?g([y],n):y},d=[];for(;;){let n=T({...r,cwd:o});if(n===R||(n&&d.push(i__default.default.resolve(o,n)),o===m||d.length>=c))break;o=i__default.default.dirname(o);}return d}function f(e,r={}){return M(e,{...r,limit:1})[0]}var S=f(["tailwind.config.ts","tailwind.config.js"]),D=localPkg.getPackageInfoSync("tailwindcss")?.version,u=D&&S?{extends:["plugin:tailwindcss/recommended"],settings:{tailwindcss:{callees:constants.tailwindFunctions,config:S}},rules:{"tailwindcss/classnames-order":["off"]}}:{extends:[],settings:void 0,rules:void 0};var j=f(["pnpm-workspace.yaml","pnpm-lock.yaml"]),Q=j&&pathe.dirname(j),s={parserOptions:{EXPERIMENTAL_useProjectService:!0,tsconfigRootDir:Q},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 b={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 rt={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",...h.extends,...v.extends,...u.extends,...b.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,...u.settings},rules:{...h.rules,...s.rules,...p.rules,...b.rules,...u.rules,"sort-imports":["off"],"max-params":["warn"]},overrides:[...x.overrides]};
17
+ var h={extends:["plugin:jsdoc/recommended-typescript-error"],rules:{"jsdoc/require-jsdoc":["error",{require:{FunctionDeclaration:!1}}],"jsdoc/tag-lines":["off"]}};var N=localPkg.getPackageInfoSync("next")?.version,v=N?{extends:["next"],rules:{"@next/next/no-html-link-for-pages":"off"}}:{extends:[],rules:void 0};var k=localPkg.getPackageInfoSync("react")?.version,p=k?{extends:["plugin:react/recommended","plugin:react-hooks/recommended"],settings:{react:{version:k}},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 P={directory:"isDirectory",file:"isFile"};function F(e){if(!Object.hasOwnProperty.call(P,e))throw new Error(`Invalid type specified: ${e}`)}var V=(e,r)=>r[P[e]](),A=e=>e instanceof URL?url.fileURLToPath(e):e;function g(e,{cwd:r=U__default.default.cwd(),type:o="file",allowSymlinks:l=!0}={}){F(o),r=A(r);let m=l?I__default.default.statSync:I__default.default.lstatSync;for(let c of e)try{let a=m(i__default.default.resolve(r,c),{throwIfNoEntry:!1});if(!a)continue;if(V(o,a))return c}catch{}}function w(e){return e instanceof URL?url.fileURLToPath(e):e}var R=Symbol("findUpStop");function M(e,r={}){let o=i__default.default.resolve(w(r.cwd)??""),{root:l}=i__default.default.parse(o),m=i__default.default.resolve(o,w(r.stopAt)??l),c=r.limit??Number.POSITIVE_INFINITY,a=[e].flat(),T=n=>{if(typeof e!="function")return g(a,n);let y=e(n.cwd);return typeof y=="string"?g([y],n):y},d=[];for(;;){let n=T({...r,cwd:o});if(n===R||(n&&d.push(i__default.default.resolve(o,n)),o===m||d.length>=c))break;o=i__default.default.dirname(o);}return d}function f(e,r={}){return M(e,{...r,limit:1})[0]}var S=f(["tailwind.config.ts","tailwind.config.js"]),O=localPkg.getPackageInfoSync("tailwindcss")?.version,u=O&&S?{extends:["plugin:tailwindcss/recommended"],settings:{tailwindcss:{callees:constants.tailwindFunctions,config:S}},rules:{"tailwindcss/classnames-order":["off"]}}:{extends:[],settings:void 0,rules:void 0};var j=f(["pnpm-workspace.yaml","pnpm-lock.yaml"]),Q=j&&pathe.dirname(j),s={parserOptions:{EXPERIMENTAL_useProjectService:!0,tsconfigRootDir:Q},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","@typescript-eslint/no-confusing-void-expression":["error",{ignoreArrowShorthand:!0,ignoreVoidOperator:!0}]}};var b={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 rt={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",...h.extends,...v.extends,...u.extends,...b.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,...u.settings},rules:{...h.rules,...s.rules,...p.rules,...b.rules,...u.rules,"sort-imports":["off"],"max-params":["warn"]},overrides:[...x.overrides]};
18
18
 
19
19
  module.exports = rt;
20
20
  //# sourceMappingURL=out.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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/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","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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B,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,GAAGvC,EAAU,OAAO,EACrD,QAAS,CACP,qBACA,QACA,mDAEA,GAAGN,EAAM,QAET,GAAGG,EAAK,QAER,GAAGsC,EAAS,QAEZ,GAAGK,EAAQ,QAEX,GAAGD,EAAW,QAEd,8BAEA,GAAGxC,EAAM,QAET,UACF,EACA,OAAQwC,EAAW,OACnB,IAAK,CACH,IAAK,GACL,KAAM,EACR,EACA,eAAgB,CACd,eACA,OACA,QACA,WACA,SACA,MACA,YACA,kBACA,WACF,EACA,SAAU,CACR,GAAGxC,EAAM,SAET,GAAGoC,EAAS,QACd,EACA,MAAO,CACL,GAAGzC,EAAM,MAET,GAAG6C,EAAW,MAEd,GAAGxC,EAAM,MAET,GAAGyC,EAAQ,MAEX,GAAGL,EAAS,MAEZ,eAAgB,CAAC,KAAK,EACtB,aAAc,CAAC,MAAM,CACvB,EACA,UAAW,CAAC,GAAGnC,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","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"]}
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/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","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,E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,IAAOC,GAAqB,CAC1B,KAAM,GACN,cAAe,CACb,WAAY,SACZ,cAAe,CACb,KAAM,UACR,EAEA,GAAGF,EAAW,aAChB,EACA,QAAS,CAAC,GAAGA,EAAW,QAAS,GAAGvC,EAAU,OAAO,EACrD,QAAS,CACP,qBACA,QACA,mDAEA,GAAGN,EAAM,QAET,GAAGG,EAAK,QAER,GAAGsC,EAAS,QAEZ,GAAGK,EAAQ,QAEX,GAAGD,EAAW,QAEd,8BAEA,GAAGxC,EAAM,QAET,UACF,EACA,OAAQwC,EAAW,OACnB,IAAK,CACH,IAAK,GACL,KAAM,EACR,EACA,eAAgB,CACd,eACA,OACA,QACA,WACA,SACA,MACA,YACA,kBACA,WACF,EACA,SAAU,CACR,GAAGxC,EAAM,SAET,GAAGoC,EAAS,QACd,EACA,MAAO,CACL,GAAGzC,EAAM,MAET,GAAG6C,EAAW,MAEd,GAAGxC,EAAM,MAET,GAAGyC,EAAQ,MAEX,GAAGL,EAAS,MAEZ,eAAgB,CAAC,KAAK,EACtB,aAAc,CAAC,MAAM,CACvB,EACA,UAAW,CAAC,GAAGnC,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","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 '@typescript-eslint/no-confusing-void-expression': [\n 'error',\n { ignoreArrowShorthand: true, ignoreVoidOperator: true },\n ],\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
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
6
6
  import { tailwindFunctions } from '@2digits/constants';
7
7
  import { dirname } from 'pathe';
8
8
 
9
- var x={extends:["plugin:jsdoc/recommended-typescript-error"],rules:{"jsdoc/require-jsdoc":["error",{require:{FunctionDeclaration:!1}}],"jsdoc/tag-lines":["off"]}};var C=getPackageInfoSync("next")?.version,k=C?{extends:["next"],rules:{"@next/next/no-html-link-for-pages":"off"}}:{extends:[],rules:void 0};var I=getPackageInfoSync("react")?.version,f=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 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 S={directory:"isDirectory",file:"isFile"};function V(e){if(!Object.hasOwnProperty.call(S,e))throw new Error(`Invalid type specified: ${e}`)}var _=(e,o)=>o[S[e]](),A=e=>e instanceof URL?fileURLToPath(e):e;function w(e,{cwd:o=L.cwd(),type:n="file",allowSymlinks:m=!0}={}){V(n),o=A(o);let d=m?P.statSync:P.lstatSync;for(let a of e)try{let p=d(c.resolve(o,a),{throwIfNoEntry:!1});if(!p)continue;if(_(n,p))return a}catch{}}function b(e){return e instanceof URL?fileURLToPath(e):e}var M=Symbol("findUpStop");function z(e,o={}){let n=c.resolve(b(o.cwd)??""),{root:m}=c.parse(n),d=c.resolve(n,b(o.stopAt)??m),a=o.limit??Number.POSITIVE_INFINITY,p=[e].flat(),E=s=>{if(typeof e!="function")return w(p,s);let h=e(s.cwd);return typeof h=="string"?w([h],s):h},y=[];for(;;){let s=E({...o,cwd:n});if(s===M||(s&&y.push(c.resolve(n,s)),n===d||y.length>=a))break;n=c.dirname(n);}return y}function u(e,o={}){return z(e,{...o,limit:1})[0]}var j=u(["tailwind.config.ts","tailwind.config.js"]),O=getPackageInfoSync("tailwindcss")?.version,l=O&&j?{extends:["plugin:tailwindcss/recommended"],settings:{tailwindcss:{callees:tailwindFunctions,config:j}},rules:{"tailwindcss/classnames-order":["off"]}}:{extends:[],settings:void 0,rules:void 0};var T=u(["pnpm-workspace.yaml","pnpm-lock.yaml"]),X=T&&dirname(T),i={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 et={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",...x.extends,...k.extends,...l.extends,...v.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,...l.settings},rules:{...x.rules,...i.rules,...f.rules,...v.rules,...l.rules,"sort-imports":["off"],"max-params":["warn"]},overrides:[...g.overrides]};
9
+ var x={extends:["plugin:jsdoc/recommended-typescript-error"],rules:{"jsdoc/require-jsdoc":["error",{require:{FunctionDeclaration:!1}}],"jsdoc/tag-lines":["off"]}};var C=getPackageInfoSync("next")?.version,k=C?{extends:["next"],rules:{"@next/next/no-html-link-for-pages":"off"}}:{extends:[],rules:void 0};var I=getPackageInfoSync("react")?.version,f=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 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 S={directory:"isDirectory",file:"isFile"};function V(e){if(!Object.hasOwnProperty.call(S,e))throw new Error(`Invalid type specified: ${e}`)}var A=(e,o)=>o[S[e]](),_=e=>e instanceof URL?fileURLToPath(e):e;function w(e,{cwd:o=L.cwd(),type:n="file",allowSymlinks:m=!0}={}){V(n),o=_(o);let d=m?P.statSync:P.lstatSync;for(let a of e)try{let p=d(c.resolve(o,a),{throwIfNoEntry:!1});if(!p)continue;if(A(n,p))return a}catch{}}function b(e){return e instanceof URL?fileURLToPath(e):e}var M=Symbol("findUpStop");function z(e,o={}){let n=c.resolve(b(o.cwd)??""),{root:m}=c.parse(n),d=c.resolve(n,b(o.stopAt)??m),a=o.limit??Number.POSITIVE_INFINITY,p=[e].flat(),E=s=>{if(typeof e!="function")return w(p,s);let h=e(s.cwd);return typeof h=="string"?w([h],s):h},y=[];for(;;){let s=E({...o,cwd:n});if(s===M||(s&&y.push(c.resolve(n,s)),n===d||y.length>=a))break;n=c.dirname(n);}return y}function u(e,o={}){return z(e,{...o,limit:1})[0]}var j=u(["tailwind.config.ts","tailwind.config.js"]),D=getPackageInfoSync("tailwindcss")?.version,l=D&&j?{extends:["plugin:tailwindcss/recommended"],settings:{tailwindcss:{callees:tailwindFunctions,config:j}},rules:{"tailwindcss/classnames-order":["off"]}}:{extends:[],settings:void 0,rules:void 0};var T=u(["pnpm-workspace.yaml","pnpm-lock.yaml"]),X=T&&dirname(T),i={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","@typescript-eslint/no-confusing-void-expression":["error",{ignoreArrowShorthand:!0,ignoreVoidOperator:!0}]}};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 et={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",...x.extends,...k.extends,...l.extends,...v.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,...l.settings},rules:{...x.rules,...i.rules,...f.rules,...v.rules,...l.rules,"sort-imports":["off"],"max-params":["warn"]},overrides:[...g.overrides]};
10
10
 
11
11
  export { et as default };
12
12
  //# sourceMappingURL=out.js.map
@@ -1 +1 @@
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/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","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,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/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,ECHA,IAAOC,GAAqB,CAC1B,KAAM,GACN,cAAe,CACb,WAAY,SACZ,cAAe,CACb,KAAM,UACR,EAEA,GAAGF,EAAW,aAChB,EACA,QAAS,CAAC,GAAGA,EAAW,QAAS,GAAGvC,EAAU,OAAO,EACrD,QAAS,CACP,qBACA,QACA,mDAEA,GAAGN,EAAM,QAET,GAAGG,EAAK,QAER,GAAGsC,EAAS,QAEZ,GAAGK,EAAQ,QAEX,GAAGD,EAAW,QAEd,8BAEA,GAAGxC,EAAM,QAET,UACF,EACA,OAAQwC,EAAW,OACnB,IAAK,CACH,IAAK,GACL,KAAM,EACR,EACA,eAAgB,CACd,eACA,OACA,QACA,WACA,SACA,MACA,YACA,kBACA,WACF,EACA,SAAU,CACR,GAAGxC,EAAM,SAET,GAAGoC,EAAS,QACd,EACA,MAAO,CACL,GAAGzC,EAAM,MAET,GAAG6C,EAAW,MAEd,GAAGxC,EAAM,MAET,GAAGyC,EAAQ,MAEX,GAAGL,EAAS,MAEZ,eAAgB,CAAC,KAAK,EACtB,aAAc,CAAC,MAAM,CACvB,EACA,UAAW,CAAC,GAAGnC,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","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"]}
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/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","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,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EAAU,OAAO,EACrD,QAAS,CACP,qBACA,QACA,mDAEA,GAAGN,EAAM,QAET,GAAGG,EAAK,QAER,GAAGsC,EAAS,QAEZ,GAAGK,EAAQ,QAEX,GAAGD,EAAW,QAEd,8BAEA,GAAGxC,EAAM,QAET,UACF,EACA,OAAQwC,EAAW,OACnB,IAAK,CACH,IAAK,GACL,KAAM,EACR,EACA,eAAgB,CACd,eACA,OACA,QACA,WACA,SACA,MACA,YACA,kBACA,WACF,EACA,SAAU,CACR,GAAGxC,EAAM,SAET,GAAGoC,EAAS,QACd,EACA,MAAO,CACL,GAAGzC,EAAM,MAET,GAAG6C,EAAW,MAEd,GAAGxC,EAAM,MAET,GAAGyC,EAAQ,MAEX,GAAGL,EAAS,MAEZ,eAAgB,CAAC,KAAK,EACtB,aAAc,CAAC,MAAM,CACvB,EACA,UAAW,CAAC,GAAGnC,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","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 '@typescript-eslint/no-confusing-void-expression': [\n 'error',\n { ignoreArrowShorthand: true, ignoreVoidOperator: true },\n ],\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.3.1",
4
+ "version": "1.5.0",
5
5
  "license": "MIT",
6
6
  "public": true,
7
7
  "sideEffects": false,
@@ -28,19 +28,19 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@2digits/constants": "0.1.4",
32
- "@2digits/eslint-plugin": "1.0.5",
31
+ "@2digits/constants": "0.1.5",
32
+ "@2digits/eslint-plugin": "1.1.0",
33
33
  "@tanstack/eslint-plugin-query": "^5.20.1",
34
- "@typescript-eslint/eslint-plugin": "^7.1.0",
35
- "@typescript-eslint/parser": "^7.1.0",
36
- "eslint-config-next": "^14.1.0",
34
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
35
+ "@typescript-eslint/parser": "^7.2.0",
36
+ "eslint-config-next": "^14.1.3",
37
37
  "eslint-config-prettier": "^9.1.0",
38
- "eslint-config-turbo": "^1.12.4",
39
- "eslint-plugin-jsdoc": "^48.2.0",
40
- "eslint-plugin-react": "^7.33.2",
38
+ "eslint-config-turbo": "^1.12.5",
39
+ "eslint-plugin-jsdoc": "^48.2.1",
40
+ "eslint-plugin-react": "^7.34.0",
41
41
  "eslint-plugin-react-hooks": "^4.6.0",
42
42
  "eslint-plugin-storybook": "^0.8.0",
43
- "eslint-plugin-tailwindcss": "^3.14.3",
43
+ "eslint-plugin-tailwindcss": "^3.15.0",
44
44
  "eslint-plugin-unicorn": "^51.0.1",
45
45
  "find-up": "^7.0.0",
46
46
  "local-pkg": "^0.5.0",
@@ -55,7 +55,7 @@
55
55
  "eslint": "^8.57.0",
56
56
  "eslint-define-config": "^2.1.0",
57
57
  "tsup": "^8.0.2",
58
- "typescript": "^5.3.3"
58
+ "typescript": "^5.4.2"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsup",