@jimmy.codes/eslint-config 1.0.0 → 1.1.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/README.md +0 -5
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -24,7 +24,6 @@ Then if you want a simple configuration:
|
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
26
|
// eslint.config.mjs
|
|
27
|
-
// @ts-check
|
|
28
27
|
import jimmyDotCodes from "@jimmy.codes/eslint-config";
|
|
29
28
|
|
|
30
29
|
export default jimmyDotCodes();
|
|
@@ -45,7 +44,6 @@ This package contains rules that can be enabled or disabled as follows:
|
|
|
45
44
|
|
|
46
45
|
```js
|
|
47
46
|
// eslint.config.mjs
|
|
48
|
-
// @ts-check
|
|
49
47
|
import jimmyDotCodes from "@jimmy.codes/eslint-config";
|
|
50
48
|
|
|
51
49
|
export default jimmyDotCodes({
|
|
@@ -73,7 +71,6 @@ You can also change the project location which can be helpful for monorepos:
|
|
|
73
71
|
|
|
74
72
|
```js
|
|
75
73
|
// eslint.config.mjs
|
|
76
|
-
// @ts-check
|
|
77
74
|
import jimmyDotCodes from "@jimmy.codes/eslint-config";
|
|
78
75
|
|
|
79
76
|
export default jimmyDotCodes({
|
|
@@ -89,7 +86,6 @@ By default [vitest](https://vitest.dev) is used as the testing framework but you
|
|
|
89
86
|
|
|
90
87
|
```js
|
|
91
88
|
// eslint.config.mjs
|
|
92
|
-
// @ts-check
|
|
93
89
|
import jimmyDotCodes from "@jimmy.codes/eslint-config";
|
|
94
90
|
|
|
95
91
|
export default jimmyDotCodes({
|
|
@@ -106,7 +102,6 @@ You can also extend or override the configuration:
|
|
|
106
102
|
|
|
107
103
|
```js
|
|
108
104
|
// eslint.config.mjs
|
|
109
|
-
// @ts-check
|
|
110
105
|
import jimmyDotCodes from "@jimmy.codes/eslint-config";
|
|
111
106
|
|
|
112
107
|
export default jimmyDotCodes({
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var j=require("eslint-config-prettier"),s=require("eslint-plugin-import-x"),y=require("eslint-plugin-node-import"),g=require("eslint-plugin-simple-import-sort"),i=require("eslint-plugin-jsx-a11y"),x=require("eslint-plugin-react"),h=require("eslint-plugin-react-hooks"),b=require("eslint-plugin-react-refresh"),v=require("globals"),a=require("eslint-plugin-jest"),k=require("eslint-plugin-jest-dom"),p=require("eslint-plugin-testing-library"),
|
|
1
|
+
"use strict";var j=require("eslint-config-prettier"),s=require("eslint-plugin-import-x"),y=require("eslint-plugin-node-import"),g=require("eslint-plugin-simple-import-sort"),i=require("eslint-plugin-jsx-a11y"),x=require("eslint-plugin-react"),h=require("eslint-plugin-react-hooks"),b=require("eslint-plugin-react-refresh"),v=require("globals"),a=require("eslint-plugin-jest"),k=require("eslint-plugin-jest-dom"),p=require("eslint-plugin-testing-library"),n=require("typescript-eslint"),q=require("@eslint/js");function f(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if(t!=="default"){var c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,c.get?c:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}var _=f(b),l=f(k);const O={...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"},w={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},C=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":s,"simple-import-sort":g,"node-import":y},rules:O},...e?[w]:[]],o="?([cm])[jt]s?(x)",E=["**/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"],L="**/*.?([cm])js",m="**/*.?([cm])jsx",S="**/*.?([cm])tsx",u=[`**/__tests__/**/*.${o}`,`**/*.spec.${o}`,`**/*.test.${o}`,`**/*.bench.${o}`,`**/*.benchmark.${o}`],d=[`**/e2e/**/*.spec.${o}`,`**/e2e/**/*.test.${o}`],T={...i.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","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"},G=()=>[{name:"jimmy.codes/react",files:[m,S],plugins:{react:x,"react-hooks":h,"jsx-a11y":{rules:i.rules},"react-refresh":_},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...v.browser}},settings:{react:{version:"detect"}},rules:T}],R={...a.configs["flat/recommended"].rules,...a.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:u,plugins:{"testing-library":p,"jest-dom":l},rules:{...p.configs.react.rules,...l.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:d,rules:{"testing-library/prefer-screen-queries":"off"}}],D=({framework:e="vitest",utilities:r})=>[{name:"jimmy.codes/testing",files:u,...a.configs["flat/recommended"],rules:{...R,...e==="vitest"&&{"jest/no-deprecated-functions":"off"}}},{name:"jimmy.codes/testing/disabled",files:d,rules:{"jest/require-hook":"off"}},...r?.includes("testing-library")?B():[]],$=e=>n.config(...n.configs.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...n.configs.strictTypeChecked,...n.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}}]}},{files:[L,m],...n.configs.disableTypeChecked}),I={...q.configs.recommended.rules,curly:"error","arrow-body-style":["error","always"],"object-shorthand":"error","prefer-arrow-callback":"error"},N=e=>typeof e=="object"?e:{project:"./tsconfig.json"},P=e=>typeof e=="object"?e:{framework:"vitest"},X=({typescript:e=!1,react:r=!1,testing:t=!1,overrides:c=[]}={})=>[{name:"jimmy.codes/base",rules:I},...C({typescript:e}),...e?$(N(e)):[],...r?G():[],...t?D(P(t)):[],{name:"jimmy.codes/disabled",...j},{ignores:E},...c];module.exports=X;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import u from"eslint-config-prettier";import
|
|
1
|
+
import u from"eslint-config-prettier";import t from"eslint-plugin-import-x";import j from"eslint-plugin-node-import";import y from"eslint-plugin-simple-import-sort";import a from"eslint-plugin-jsx-a11y";import g from"eslint-plugin-react";import x from"eslint-plugin-react-hooks";import*as h from"eslint-plugin-react-refresh";import b from"globals";import n from"eslint-plugin-jest";import*as i from"eslint-plugin-jest-dom";import p from"eslint-plugin-testing-library";import{config as k,configs as o}from"typescript-eslint";import v from"@eslint/js";const w={...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"},_={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},C=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":t,"simple-import-sort":y,"node-import":j},rules:w},...e?[_]:[]],r="?([cm])[jt]s?(x)",O=["**/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"],q="**/*.?([cm])js",f="**/*.?([cm])jsx",L="**/*.?([cm])tsx",m=[`**/__tests__/**/*.${r}`,`**/*.spec.${r}`,`**/*.test.${r}`,`**/*.bench.${r}`,`**/*.benchmark.${r}`],l=[`**/e2e/**/*.spec.${r}`,`**/e2e/**/*.test.${r}`],S={...a.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","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"},T=()=>[{name:"jimmy.codes/react",files:[f,L],plugins:{react:g,"react-hooks":x,"jsx-a11y":{rules:a.rules},"react-refresh":h},languageOptions:{parserOptions:{jsxPragma:null,ecmaFeatures:{jsx:!0}},globals:{...b.browser}},settings:{react:{version:"detect"}},rules:S}],E={...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"},G=()=>[{name:"jimmy.codes/testing/testing-library",files:m,plugins:{"testing-library":p,"jest-dom":i},rules:{...p.configs.react.rules,...i.configs["flat/recommended"].rules}},{name:"jimmy.codes/testing/testing-library/disabled",files:l,rules:{"testing-library/prefer-screen-queries":"off"}}],R=({framework:e="vitest",utilities:s})=>[{name:"jimmy.codes/testing",files:m,...n.configs["flat/recommended"],rules:{...E,...e==="vitest"&&{"jest/no-deprecated-functions":"off"}}},{name:"jimmy.codes/testing/disabled",files:l,rules:{"jest/require-hook":"off"}},...s?.includes("testing-library")?G():[]],B=e=>k(...o.strictTypeChecked,{name:"jimmy.codes/typescript",extends:[...o.strictTypeChecked,...o.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}}]}},{files:[q,f],...o.disableTypeChecked}),$={...v.configs.recommended.rules,curly:"error","arrow-body-style":["error","always"],"object-shorthand":"error","prefer-arrow-callback":"error"},I=e=>typeof e=="object"?e:{project:"./tsconfig.json"},D=e=>typeof e=="object"?e:{framework:"vitest"},X=({typescript:e=!1,react:s=!1,testing:c=!1,overrides:d=[]}={})=>[{name:"jimmy.codes/base",rules:$},...C({typescript:e}),...e?B(I(e)):[],...s?T():[],...c?R(D(c)):[],{name:"jimmy.codes/disabled",...u},{ignores:O},...d];export{X as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jimmy.codes/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "another opinionated eslint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@eslint/js": "^8.57.0",
|
|
35
|
-
"@typescript-eslint/utils": "^7.
|
|
35
|
+
"@typescript-eslint/utils": "^7.6.0",
|
|
36
36
|
"eslint-config-prettier": "^9.1.0",
|
|
37
37
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
38
38
|
"eslint-plugin-import-x": "0.5.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
47
47
|
"eslint-plugin-testing-library": "^6.2.0",
|
|
48
48
|
"globals": "^15.0.0",
|
|
49
|
-
"typescript-eslint": "^7.
|
|
49
|
+
"typescript-eslint": "^7.6.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"eslint": "^8.57.0"
|