@jimmy.codes/eslint-config 1.3.0 → 1.4.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.cjs +1 -1
- package/dist/index.d.cts +50 -0
- package/dist/index.d.mts +50 -0
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var x=require("eslint-config-prettier"),l=require("globals"),s=require("eslint-plugin-import-x"),h=require("eslint-plugin-node-import"),b=require("eslint-plugin-simple-import-sort"),v=require("@tanstack/eslint-plugin-query"),m=require("eslint-plugin-jsx-a11y"),k=require("eslint-plugin-react"),q=require("eslint-plugin-react-hooks"),O=require("eslint-plugin-react-refresh"),n=require("eslint-plugin-jest"),_=require("eslint-plugin-jest-dom"),u=require("eslint-plugin-testing-library"),
|
|
1
|
+
"use strict";var x=require("eslint-config-prettier"),l=require("globals"),s=require("eslint-plugin-import-x"),h=require("eslint-plugin-node-import"),b=require("eslint-plugin-simple-import-sort"),v=require("@tanstack/eslint-plugin-query"),m=require("eslint-plugin-jsx-a11y"),k=require("eslint-plugin-react"),q=require("eslint-plugin-react-hooks"),O=require("eslint-plugin-react-refresh"),n=require("eslint-plugin-jest"),_=require("eslint-plugin-jest-dom"),u=require("eslint-plugin-testing-library"),c=require("typescript-eslint"),w=require("@eslint/js");function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,Object.freeze(t)}var C=p(v),E=p(O),d=p(_);const L={...s.configs.recommended.rules,"import-x/namespace":"off","import-x/newline-after-import":"error","import-x/first":"error","import-x/no-absolute-path":"error","import-x/no-useless-path-segments":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","simple-import-sort/imports":"error","simple-import-sort/exports":"error","node-import/prefer-node-protocol":"error"},S={name:"jimmy.codes/imports/typescript",settings:{...s.configs.typescript.settings,"import-x/resolver":{...s.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:s.configs.typescript.rules},T=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":s,"simple-import-sort":b,"node-import":h},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:L},...e?[S]:[]],r="?([cm])[jt]s?(x)",G=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs"],R="**/*.?([cm])js",f="**/*.?([cm])jsx",j="**/*.?([cm])tsx",i=[`**/__tests__/**/*.${r}`,`**/*.spec.${r}`,`**/*.test.${r}`,`**/*.bench.${r}`,`**/*.benchmark.${r}`],y=[`**/e2e/**/*.spec.${r}`,`**/e2e/**/*.test.${r}`,`**/cypress/**/*.spec.${r}`,`**/cypress/**/*.test.${r}`],$="**/*.cjs",B=["vi.mock"],D={...m.configs.recommended.rules,"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react/display-name":"error","react/jsx-key":"error","react/jsx-no-comment-textnodes":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"error","react/jsx-uses-vars":"error","react/no-children-prop":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-render-return-value":"error","react/no-string-refs":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/prop-types":"error","react/require-render-return":"error","react/react-in-jsx-scope":"off","react/jsx-uses-react":"off","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"react/self-closing-comp":"error","react/jsx-curly-brace-presence":"error","react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"off","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"},I=({utilities:e=[]}={})=>[{name:"jimmy.codes/react",files:[f,j],plugins:{react:k,"react-hooks":q,"jsx-a11y":{rules:m.rules},"react-refresh":E},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...l.browser}},settings:{react:{version:"detect"}},rules:D},...e.includes("@tanstack/query")?[{name:"jimmy.codes/react/query",files:[f,j],plugins:{"@tanstack/query":C},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]],g={...n.configs["flat/recommended"].rules,...n.configs["flat/style"].rules,"jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"},N=()=>[{name:"jimmy.codes/testing/testing-library",files:i,plugins:{"testing-library":u,"jest-dom":d},rules:{...u.configs.react.rules,...d.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:y,rules:{"testing-library/prefer-screen-queries":"off"}}],P=({framework:e="vitest",utilities:t}={})=>[{name:"jimmy.codes/testing",files:i,...n.configs["flat/recommended"]},...e==="vitest"?[{name:"jimmy.codes/testing/vitest",files:i,...n.configs["flat/recommended"],rules:{...g,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:B}]}}]:[{name:"jimmy.codes/testing/jest",files:i,...n.configs["flat/recommended"],rules:g}],{name:"jimmy.codes/testing/disabled",files:y,rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...t?.includes("testing-library")?N():[]],X=e=>c.config(...c.configs.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...c.configs.strictTypeChecked,...c.configs.stylisticTypeChecked],languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},rules:{"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"inline-type-imports"}],"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[R,f],...c.configs.disableTypeChecked}),A={...w.configs.recommended.rules,curly:"error","arrow-body-style":["error","always"],"object-shorthand":"error","prefer-arrow-callback":"error","no-console":"warn"},F=e=>typeof e=="object"?e:{project:"./tsconfig.json"},J=e=>typeof e=="object"?e:{framework:"vitest"},V=e=>typeof e=="object"?e:{utilities:[]},z=({typescript:e=!1,react:t=!1,testing:o=!1,overrides:a=[]}={})=>[{name:"jimmy.codes/base",rules:A},...T({typescript:e}),...e?X(F(e)):[],...t?I(V(t)):[],...o?P(J(o)):[],{name:"jimmy.codes/disabled",...x},{name:"jimmy.codes/commonjs",files:[$],languageOptions:{globals:l.commonjs}},{ignores:G},...a];module.exports=z;
|
package/dist/index.d.cts
CHANGED
|
@@ -1623,6 +1623,53 @@ declare const jimmyDotCodes: ({ typescript, react, testing, overrides, }?: Optio
|
|
|
1623
1623
|
"jest/require-to-throw-message": "error";
|
|
1624
1624
|
"jest/require-top-level-describe": "off";
|
|
1625
1625
|
"jest/unbound-method": "off";
|
|
1626
|
+
"jest/expect-expect"?: undefined;
|
|
1627
|
+
};
|
|
1628
|
+
plugins: string[];
|
|
1629
|
+
languageOptions: {
|
|
1630
|
+
ecmaVersion?: "latest" | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | undefined;
|
|
1631
|
+
sourceType?: "module" | "script" | "commonjs" | undefined;
|
|
1632
|
+
globals?: eslint.ESLint.Globals | undefined;
|
|
1633
|
+
parser?: eslint.Linter.FlatConfigParserModule | undefined;
|
|
1634
|
+
parserOptions?: eslint.Linter.ParserOptions | undefined;
|
|
1635
|
+
} | undefined;
|
|
1636
|
+
name: string;
|
|
1637
|
+
files: string[];
|
|
1638
|
+
} | {
|
|
1639
|
+
rules: {
|
|
1640
|
+
"jest/no-alias-methods": "error";
|
|
1641
|
+
"jest/no-commented-out-tests": "error";
|
|
1642
|
+
"jest/consistent-test-it": ["error", {
|
|
1643
|
+
fn: string;
|
|
1644
|
+
withinDescribe: string;
|
|
1645
|
+
}];
|
|
1646
|
+
"jest/no-conditional-in-test": "error";
|
|
1647
|
+
"jest/no-confusing-set-timeout": "error";
|
|
1648
|
+
"jest/no-duplicate-hooks": "error";
|
|
1649
|
+
"jest/no-hooks": "off";
|
|
1650
|
+
"jest/no-large-snapshots": "off";
|
|
1651
|
+
"jest/no-restricted-jest-methods": "off";
|
|
1652
|
+
"jest/no-restricted-matchers": "off";
|
|
1653
|
+
"jest/no-test-return-statement": "error";
|
|
1654
|
+
"jest/no-untyped-mock-factory": "off";
|
|
1655
|
+
"jest/prefer-called-with": "error";
|
|
1656
|
+
"jest/prefer-comparison-matcher": "error";
|
|
1657
|
+
"jest/prefer-each": "error";
|
|
1658
|
+
"jest/prefer-equality-matcher": "error";
|
|
1659
|
+
"jest/prefer-expect-assertions": "off";
|
|
1660
|
+
"jest/prefer-expect-resolves": "error";
|
|
1661
|
+
"jest/prefer-hooks-in-order": "error";
|
|
1662
|
+
"jest/prefer-hooks-on-top": "error";
|
|
1663
|
+
"jest/prefer-lowercase-title": "off";
|
|
1664
|
+
"jest/prefer-mock-promise-shorthand": "error";
|
|
1665
|
+
"jest/prefer-snapshot-hint": "error";
|
|
1666
|
+
"jest/prefer-spy-on": "off";
|
|
1667
|
+
"jest/prefer-strict-equal": "error";
|
|
1668
|
+
"jest/prefer-todo": "warn";
|
|
1669
|
+
"jest/require-hook": "error";
|
|
1670
|
+
"jest/require-to-throw-message": "error";
|
|
1671
|
+
"jest/require-top-level-describe": "off";
|
|
1672
|
+
"jest/unbound-method": "off";
|
|
1626
1673
|
};
|
|
1627
1674
|
plugins: string[];
|
|
1628
1675
|
languageOptions: {
|
|
@@ -1638,6 +1685,8 @@ declare const jimmyDotCodes: ({ typescript, react, testing, overrides, }?: Optio
|
|
|
1638
1685
|
name: string;
|
|
1639
1686
|
files: string[];
|
|
1640
1687
|
rules: {
|
|
1688
|
+
"jest/expect-expect": string;
|
|
1689
|
+
"jest/no-deprecated-functions": string;
|
|
1641
1690
|
"jest/require-hook": string;
|
|
1642
1691
|
};
|
|
1643
1692
|
} | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
|
|
@@ -1647,6 +1696,7 @@ declare const jimmyDotCodes: ({ typescript, react, testing, overrides, }?: Optio
|
|
|
1647
1696
|
"arrow-body-style": ["error", string];
|
|
1648
1697
|
"object-shorthand": "error";
|
|
1649
1698
|
"prefer-arrow-callback": "error";
|
|
1699
|
+
"no-console": "warn";
|
|
1650
1700
|
};
|
|
1651
1701
|
files?: undefined;
|
|
1652
1702
|
languageOptions?: undefined;
|
package/dist/index.d.mts
CHANGED
|
@@ -1623,6 +1623,53 @@ declare const jimmyDotCodes: ({ typescript, react, testing, overrides, }?: Optio
|
|
|
1623
1623
|
"jest/require-to-throw-message": "error";
|
|
1624
1624
|
"jest/require-top-level-describe": "off";
|
|
1625
1625
|
"jest/unbound-method": "off";
|
|
1626
|
+
"jest/expect-expect"?: undefined;
|
|
1627
|
+
};
|
|
1628
|
+
plugins: string[];
|
|
1629
|
+
languageOptions: {
|
|
1630
|
+
ecmaVersion?: "latest" | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | undefined;
|
|
1631
|
+
sourceType?: "module" | "script" | "commonjs" | undefined;
|
|
1632
|
+
globals?: eslint.ESLint.Globals | undefined;
|
|
1633
|
+
parser?: eslint.Linter.FlatConfigParserModule | undefined;
|
|
1634
|
+
parserOptions?: eslint.Linter.ParserOptions | undefined;
|
|
1635
|
+
} | undefined;
|
|
1636
|
+
name: string;
|
|
1637
|
+
files: string[];
|
|
1638
|
+
} | {
|
|
1639
|
+
rules: {
|
|
1640
|
+
"jest/no-alias-methods": "error";
|
|
1641
|
+
"jest/no-commented-out-tests": "error";
|
|
1642
|
+
"jest/consistent-test-it": ["error", {
|
|
1643
|
+
fn: string;
|
|
1644
|
+
withinDescribe: string;
|
|
1645
|
+
}];
|
|
1646
|
+
"jest/no-conditional-in-test": "error";
|
|
1647
|
+
"jest/no-confusing-set-timeout": "error";
|
|
1648
|
+
"jest/no-duplicate-hooks": "error";
|
|
1649
|
+
"jest/no-hooks": "off";
|
|
1650
|
+
"jest/no-large-snapshots": "off";
|
|
1651
|
+
"jest/no-restricted-jest-methods": "off";
|
|
1652
|
+
"jest/no-restricted-matchers": "off";
|
|
1653
|
+
"jest/no-test-return-statement": "error";
|
|
1654
|
+
"jest/no-untyped-mock-factory": "off";
|
|
1655
|
+
"jest/prefer-called-with": "error";
|
|
1656
|
+
"jest/prefer-comparison-matcher": "error";
|
|
1657
|
+
"jest/prefer-each": "error";
|
|
1658
|
+
"jest/prefer-equality-matcher": "error";
|
|
1659
|
+
"jest/prefer-expect-assertions": "off";
|
|
1660
|
+
"jest/prefer-expect-resolves": "error";
|
|
1661
|
+
"jest/prefer-hooks-in-order": "error";
|
|
1662
|
+
"jest/prefer-hooks-on-top": "error";
|
|
1663
|
+
"jest/prefer-lowercase-title": "off";
|
|
1664
|
+
"jest/prefer-mock-promise-shorthand": "error";
|
|
1665
|
+
"jest/prefer-snapshot-hint": "error";
|
|
1666
|
+
"jest/prefer-spy-on": "off";
|
|
1667
|
+
"jest/prefer-strict-equal": "error";
|
|
1668
|
+
"jest/prefer-todo": "warn";
|
|
1669
|
+
"jest/require-hook": "error";
|
|
1670
|
+
"jest/require-to-throw-message": "error";
|
|
1671
|
+
"jest/require-top-level-describe": "off";
|
|
1672
|
+
"jest/unbound-method": "off";
|
|
1626
1673
|
};
|
|
1627
1674
|
plugins: string[];
|
|
1628
1675
|
languageOptions: {
|
|
@@ -1638,6 +1685,8 @@ declare const jimmyDotCodes: ({ typescript, react, testing, overrides, }?: Optio
|
|
|
1638
1685
|
name: string;
|
|
1639
1686
|
files: string[];
|
|
1640
1687
|
rules: {
|
|
1688
|
+
"jest/expect-expect": string;
|
|
1689
|
+
"jest/no-deprecated-functions": string;
|
|
1641
1690
|
"jest/require-hook": string;
|
|
1642
1691
|
};
|
|
1643
1692
|
} | _typescript_eslint_utils_ts_eslint.FlatConfig.Config | {
|
|
@@ -1647,6 +1696,7 @@ declare const jimmyDotCodes: ({ typescript, react, testing, overrides, }?: Optio
|
|
|
1647
1696
|
"arrow-body-style": ["error", string];
|
|
1648
1697
|
"object-shorthand": "error";
|
|
1649
1698
|
"prefer-arrow-callback": "error";
|
|
1699
|
+
"no-console": "warn";
|
|
1650
1700
|
};
|
|
1651
1701
|
files?: undefined;
|
|
1652
1702
|
languageOptions?: undefined;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import g from"eslint-config-prettier";import p from"globals";import t from"eslint-plugin-import-x";import x from"eslint-plugin-node-import";import h from"eslint-plugin-simple-import-sort";import*as b from"@tanstack/eslint-plugin-query";import f from"eslint-plugin-jsx-a11y";import k from"eslint-plugin-react";import v from"eslint-plugin-react-hooks";import*as w from"eslint-plugin-react-refresh";import o from"eslint-plugin-jest";import*as m from"eslint-plugin-jest-dom";import l from"eslint-plugin-testing-library";import{config as O,configs as n}from"typescript-eslint";import _ from"@eslint/js";const q={...t.configs.recommended.rules,"import-x/namespace":"off","import-x/newline-after-import":"error","import-x/first":"error","import-x/no-absolute-path":"error","import-x/no-useless-path-segments":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","simple-import-sort/imports":"error","simple-import-sort/exports":"error","node-import/prefer-node-protocol":"error"},C={name:"jimmy.codes/imports/typescript",settings:{...t.configs.typescript.settings,"import-x/resolver":{...t.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:t.configs.typescript.rules},L=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":t,"simple-import-sort":h,"node-import":x},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:q},...e?[C]:[]],r="?([cm])[jt]s?(x)",S=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs"],T="**/*.?([cm])js",a="**/*.?([cm])jsx",d="**/*.?([cm])tsx",c=[`**/__tests__/**/*.${r}`,`**/*.spec.${r}`,`**/*.test.${r}`,`**/*.bench.${r}`,`**/*.benchmark.${r}`],u=[`**/e2e/**/*.spec.${r}`,`**/e2e/**/*.test.${r}`],E="**/*.cjs",G=["vi.mock"],R={...f.configs.recommended.rules,"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react/display-name":"error","react/jsx-key":"error","react/jsx-no-comment-textnodes":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"error","react/jsx-uses-vars":"error","react/no-children-prop":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-render-return-value":"error","react/no-string-refs":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/prop-types":"error","react/require-render-return":"error","react/react-in-jsx-scope":"off","react/jsx-uses-react":"off","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"react/self-closing-comp":"error","react/jsx-curly-brace-presence":"error","react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"off","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"}
|
|
1
|
+
import g from"eslint-config-prettier";import p from"globals";import t from"eslint-plugin-import-x";import x from"eslint-plugin-node-import";import h from"eslint-plugin-simple-import-sort";import*as b from"@tanstack/eslint-plugin-query";import f from"eslint-plugin-jsx-a11y";import k from"eslint-plugin-react";import v from"eslint-plugin-react-hooks";import*as w from"eslint-plugin-react-refresh";import o from"eslint-plugin-jest";import*as m from"eslint-plugin-jest-dom";import l from"eslint-plugin-testing-library";import{config as O,configs as n}from"typescript-eslint";import _ from"@eslint/js";const q={...t.configs.recommended.rules,"import-x/namespace":"off","import-x/newline-after-import":"error","import-x/first":"error","import-x/no-absolute-path":"error","import-x/no-useless-path-segments":"error","import-x/no-empty-named-blocks":"error","import-x/no-self-import":"error","simple-import-sort/imports":"error","simple-import-sort/exports":"error","node-import/prefer-node-protocol":"error"},C={name:"jimmy.codes/imports/typescript",settings:{...t.configs.typescript.settings,"import-x/resolver":{...t.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:t.configs.typescript.rules},L=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":t,"simple-import-sort":h,"node-import":x},settings:{"import-x/parsers":{espree:[".js",".cjs",".mjs",".jsx"]}},languageOptions:{parserOptions:{ecmaVersion:"latest",sourceType:"module"}},rules:q},...e?[C]:[]],r="?([cm])[jt]s?(x)",S=["**/node_modules","**/dist","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/bun.lockb","**/output","**/coverage","**/temp","**/.temp","**/tmp","**/.tmp","**/.history","**/.vitepress/cache","**/.nuxt","**/.next","**/.vercel","**/.changeset","**/.idea","**/.cache","**/.output","**/.vite-inspect","**/.yarn","**/storybook-static","**/.eslint-config-inspector","**/CHANGELOG*.md","**/*.min.*","**/LICENSE*","**/__snapshots__","**/auto-import?(s).d.ts","**/components.d.ts","**/vite.config.ts.*.mjs"],T="**/*.?([cm])js",a="**/*.?([cm])jsx",d="**/*.?([cm])tsx",c=[`**/__tests__/**/*.${r}`,`**/*.spec.${r}`,`**/*.test.${r}`,`**/*.bench.${r}`,`**/*.benchmark.${r}`],u=[`**/e2e/**/*.spec.${r}`,`**/e2e/**/*.test.${r}`,`**/cypress/**/*.spec.${r}`,`**/cypress/**/*.test.${r}`],E="**/*.cjs",G=["vi.mock"],R={...f.configs.recommended.rules,"react-hooks/exhaustive-deps":"error","react-hooks/rules-of-hooks":"error","react/display-name":"error","react/jsx-key":"error","react/jsx-no-comment-textnodes":"error","react/jsx-no-duplicate-props":"error","react/jsx-no-target-blank":"error","react/jsx-no-undef":"error","react/jsx-uses-vars":"error","react/no-children-prop":"error","react/no-danger-with-children":"error","react/no-deprecated":"error","react/no-direct-mutation-state":"error","react/no-find-dom-node":"error","react/no-is-mounted":"error","react/no-render-return-value":"error","react/no-string-refs":"error","react/no-unescaped-entities":"error","react/no-unknown-property":"error","react/no-unsafe":"off","react/prop-types":"error","react/require-render-return":"error","react/react-in-jsx-scope":"off","react/jsx-uses-react":"off","react-refresh/only-export-components":["warn",{allowConstantExport:!0}],"react/self-closing-comp":"error","react/jsx-curly-brace-presence":"error","react/boolean-prop-naming":"off","react/button-has-type":"error","react/checked-requires-onchange-or-readonly":"error","react/default-props-match-prop-types":"error","react/destructuring-assignment":"off","react/forbid-component-props":"off","react/forbid-dom-props":"off","react/forbid-elements":"off","react/forbid-foreign-prop-types":"off","react/forbid-prop-types":"off","react/function-component-definition":"off","react/hook-use-state":"error","react/iframe-missing-sandbox":"error","react/jsx-boolean-value":["error","never"],"react/jsx-filename-extension":"off","react/jsx-fragments":["error","syntax"],"react/jsx-handler-names":"off","react/jsx-max-depth":"off","react/jsx-no-bind":"off","react/jsx-no-constructed-context-values":"error","react/jsx-no-leaked-render":"error","react/jsx-no-literals":"off","react/jsx-no-script-url":"error","react/jsx-no-useless-fragment":"error","react/jsx-one-expression-per-line":"off","react/jsx-pascal-case":["error",{allowNamespace:!0}],"react/jsx-props-no-spreading":"off","react/jsx-sort-default-props":"off","react/jsx-sort-props":"off","react/no-access-state-in-setstate":"error","react/no-adjacent-inline-elements":"off","react/no-array-index-key":"off","react/no-arrow-function-lifecycle":"error","react/no-danger":"off","react/no-did-mount-set-state":"error","react/no-did-update-set-state":"error","react/no-invalid-html-attribute":"error","react/no-multi-comp":"off","react/no-namespace":"error","react/no-object-type-as-default-prop":"off","react/no-redundant-should-component-update":"error","react/no-set-state":"off","react/no-this-in-sfc":"error","react/no-typos":"error","react/no-unstable-nested-components":"error","react/no-unused-class-component-methods":"error","react/no-unused-prop-types":"error","react/no-unused-state":"error","react/no-will-update-set-state":"error","react/prefer-es6-class":"off","react/prefer-exact-props":"off","react/prefer-read-only-props":"off","react/prefer-stateless-function":"off","react/require-default-props":"off","react/require-optimization":"off","react/sort-comp":"off","react/sort-default-props":"off","react/sort-prop-types":"off","react/state-in-constructor":"off","react/static-property-placement":"off","react/style-prop-object":"error","react/void-dom-elements-no-children":"error"},$=({utilities:e=[]}={})=>[{name:"jimmy.codes/react",files:[a,d],plugins:{react:k,"react-hooks":v,"jsx-a11y":{rules:f.rules},"react-refresh":w},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...p.browser}},settings:{react:{version:"detect"}},rules:R},...e.includes("@tanstack/query")?[{name:"jimmy.codes/react/query",files:[a,d],plugins:{"@tanstack/query":b},rules:{"@tanstack/query/exhaustive-deps":"error","@tanstack/query/no-rest-destructuring":"warn","@tanstack/query/stable-query-client":"error"}}]:[]],j={...o.configs["flat/recommended"].rules,...o.configs["flat/style"].rules,"jest/no-alias-methods":"error","jest/no-commented-out-tests":"error","jest/consistent-test-it":["error",{fn:"test",withinDescribe:"it"}],"jest/no-conditional-in-test":"error","jest/no-confusing-set-timeout":"error","jest/no-duplicate-hooks":"error","jest/no-hooks":"off","jest/no-large-snapshots":"off","jest/no-restricted-jest-methods":"off","jest/no-restricted-matchers":"off","jest/no-test-return-statement":"error","jest/no-untyped-mock-factory":"off","jest/prefer-called-with":"error","jest/prefer-comparison-matcher":"error","jest/prefer-each":"error","jest/prefer-equality-matcher":"error","jest/prefer-expect-assertions":"off","jest/prefer-expect-resolves":"error","jest/prefer-hooks-in-order":"error","jest/prefer-hooks-on-top":"error","jest/prefer-lowercase-title":"off","jest/prefer-mock-promise-shorthand":"error","jest/prefer-snapshot-hint":"error","jest/prefer-spy-on":"off","jest/prefer-strict-equal":"error","jest/prefer-todo":"warn","jest/require-hook":"error","jest/require-to-throw-message":"error","jest/require-top-level-describe":"off","jest/unbound-method":"off"},B=()=>[{name:"jimmy.codes/testing/testing-library",files:c,plugins:{"testing-library":l,"jest-dom":m},rules:{...l.configs.react.rules,...m.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:u,rules:{"testing-library/prefer-screen-queries":"off"}}],I=({framework:e="vitest",utilities:s}={})=>[{name:"jimmy.codes/testing",files:c,...o.configs["flat/recommended"]},...e==="vitest"?[{name:"jimmy.codes/testing/vitest",files:c,...o.configs["flat/recommended"],rules:{...j,"jest/no-deprecated-functions":"off","jest/require-hook":["error",{allowedFunctionCalls:G}]}}]:[{name:"jimmy.codes/testing/jest",files:c,...o.configs["flat/recommended"],rules:j}],{name:"jimmy.codes/testing/disabled",files:u,rules:{"jest/expect-expect":"off","jest/no-deprecated-functions":"off","jest/require-hook":"off"}},...s?.includes("testing-library")?B():[]],N=e=>O(...n.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...n.strictTypeChecked,...n.stylisticTypeChecked],languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}},rules:{"@typescript-eslint/consistent-type-imports":["error",{fixStyle:"inline-type-imports"}],"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!0}],"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/restrict-template-expressions":["error",{allowNumber:!0}]}},{files:[T,a],...n.disableTypeChecked}),D={..._.configs.recommended.rules,curly:"error","arrow-body-style":["error","always"],"object-shorthand":"error","prefer-arrow-callback":"error","no-console":"warn"},X=e=>typeof e=="object"?e:{project:"./tsconfig.json"},A=e=>typeof e=="object"?e:{framework:"vitest"},F=e=>typeof e=="object"?e:{utilities:[]},J=({typescript:e=!1,react:s=!1,testing:i=!1,overrides:y=[]}={})=>[{name:"jimmy.codes/base",rules:D},...L({typescript:e}),...e?N(X(e)):[],...s?$(F(s)):[],...i?I(A(i)):[],{name:"jimmy.codes/disabled",...g},{name:"jimmy.codes/commonjs",files:[E],languageOptions:{globals:p.commonjs}},{ignores:S},...y];export{J as default};
|