@jimmy.codes/eslint-config 1.0.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.mjs ADDED
@@ -0,0 +1 @@
1
+ import u from"eslint-config-prettier";import o 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 s 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 n}from"typescript-eslint";import v from"@eslint/js";const w={...o.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:{...o.configs.typescript.settings,"import-x/resolver":{...o.configs.typescript.settings["import-x/resolver"],typescript:!0}},rules:o.configs.typescript.rules},O=({typescript:e=!1}={})=>[{name:"jimmy.codes/imports",plugins:{"import-x":o,"simple-import-sort":y,"node-import":j},rules:w},...e?[_]:[]],t="?([cm])[jt]s?(x)",C=["**/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__/**/*.${t}`,`**/*.spec.${t}`,`**/*.test.${t}`,`**/*.bench.${t}`,`**/*.benchmark.${t}`],l=[`**/e2e/**/*.spec.${t}`,`**/e2e/**/*.test.${t}`],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"},E=()=>[{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}],G={...s.configs["flat/recommended"].rules,...s.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"},T=()=>[{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:r})=>[{name:"jimmy.codes/testing",files:m,...s.configs["flat/recommended"],rules:{...G,...e==="vitest"&&{"jest/no-deprecated-functions":"off"}}},{name:"jimmy.codes/testing/disabled",files:l,rules:{"jest/require-hook":"off"}},...r?.includes("testing-library")?T():[]],B=e=>k({name:"jimmy.codes/typescript",extends:[...n.strictTypeChecked.map(r=>({name:"jimmy.codes/typescript",...r})),...n.stylisticTypeChecked.map(r=>({name:"jimmy.codes/typescript",...r}))],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}}]}},{name:"jimmy.codes/typescript",languageOptions:{parserOptions:{project:e.project,tsconfigRootDir:process.cwd()}}},{name:"jimmy.codes/typescript",files:[q,f],...n.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:r=!1,testing:c=!1,overrides:d=[]}={})=>[{name:"jimmy.codes/base",rules:$},...O({typescript:e}),...e?B(I(e)):[],...r?E():[],...c?R(D(c)):[],{name:"jimmy.codes/disabled",...u},{ignores:C},...d];export{X as default};
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@jimmy.codes/eslint-config",
3
+ "version": "1.0.0",
4
+ "description": "another opinionated eslint config",
5
+ "keywords": [
6
+ "eslint",
7
+ "eslint-config",
8
+ "eslintconfig"
9
+ ],
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/jimmy-guzman/eslint-config.git"
13
+ },
14
+ "license": "MIT",
15
+ "sideEffects": false,
16
+ "type": "module",
17
+ "exports": {
18
+ "require": {
19
+ "types": "./dist/index.d.cts",
20
+ "default": "./dist/index.cjs"
21
+ },
22
+ "import": {
23
+ "types": "./dist/index.d.mts",
24
+ "default": "./dist/index.mjs"
25
+ }
26
+ },
27
+ "main": "./dist/index.cjs",
28
+ "module": "./dist/index.mjs",
29
+ "types": "./dist/index.d.cts",
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "dependencies": {
34
+ "@eslint/js": "^8.57.0",
35
+ "@typescript-eslint/utils": "^7.5.0",
36
+ "eslint-config-prettier": "^9.1.0",
37
+ "eslint-import-resolver-typescript": "^3.6.1",
38
+ "eslint-plugin-import-x": "0.5.0",
39
+ "eslint-plugin-jest": "^28.2.0",
40
+ "eslint-plugin-jest-dom": "^5.2.0",
41
+ "eslint-plugin-jsx-a11y": "^6.8.0",
42
+ "eslint-plugin-node-import": "^1.0.4",
43
+ "eslint-plugin-react": "^7.34.1",
44
+ "eslint-plugin-react-hooks": "^4.6.0",
45
+ "eslint-plugin-react-refresh": "0.4.6",
46
+ "eslint-plugin-simple-import-sort": "^12.0.0",
47
+ "eslint-plugin-testing-library": "^6.2.0",
48
+ "globals": "^15.0.0",
49
+ "typescript-eslint": "^7.5.0"
50
+ },
51
+ "peerDependencies": {
52
+ "eslint": "^8.57.0"
53
+ },
54
+ "engines": {
55
+ "node": ">= 20"
56
+ },
57
+ "publishConfig": {
58
+ "access": "public"
59
+ }
60
+ }