From 12c9fcddfa456c393b51d6b026f961abf2abc878 Mon Sep 17 00:00:00 2001 From: jimmy-guzman <hi@jimmyguzman.com> Date: Sun, 7 Apr 2024 19:40:29 -0500 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20group=20import?= =?UTF-8?q?s=20as=20part=20of=20base?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 - src/__snapshots__/factory.spec.ts.snap | 297 ------------------------- src/factory.spec.ts | 4 - src/factory.ts | 3 +- src/types.ts | 5 - 5 files changed, 1 insertion(+), 313 deletions(-) diff --git a/README.md b/README.md index 6ac04b5..f638d31 100644 --- a/README.md +++ b/README.md @@ -57,11 +57,6 @@ export default jimmyDotCodes({ * @default false */ react: false, - /** - * Are imports rules are enabled? - * @default true - */ - imports: true, /** * Are testing rules are enabled? * @default false diff --git a/src/__snapshots__/factory.spec.ts.snap b/src/__snapshots__/factory.spec.ts.snap index 8d634b0..b807440 100644 --- a/src/__snapshots__/factory.spec.ts.snap +++ b/src/__snapshots__/factory.spec.ts.snap @@ -63445,303 +63445,6 @@ If your function does not access \`this\`, you can annotate it with \`this: void ] `; -exports[`jimmyDotCodes > should create configuration w/o imports 1`] = ` -[ - { - "name": "jimmy.codes/base", - "rules": { - "arrow-body-style": [ - "error", - "always", - ], - "constructor-super": "error", - "curly": "error", - "for-direction": "error", - "getter-return": "error", - "no-async-promise-executor": "error", - "no-case-declarations": "error", - "no-class-assign": "error", - "no-compare-neg-zero": "error", - "no-cond-assign": "error", - "no-const-assign": "error", - "no-constant-condition": "error", - "no-control-regex": "error", - "no-debugger": "error", - "no-delete-var": "error", - "no-dupe-args": "error", - "no-dupe-class-members": "error", - "no-dupe-else-if": "error", - "no-dupe-keys": "error", - "no-duplicate-case": "error", - "no-empty": "error", - "no-empty-character-class": "error", - "no-empty-pattern": "error", - "no-ex-assign": "error", - "no-extra-boolean-cast": "error", - "no-extra-semi": "error", - "no-fallthrough": "error", - "no-func-assign": "error", - "no-global-assign": "error", - "no-import-assign": "error", - "no-inner-declarations": "error", - "no-invalid-regexp": "error", - "no-irregular-whitespace": "error", - "no-loss-of-precision": "error", - "no-misleading-character-class": "error", - "no-mixed-spaces-and-tabs": "error", - "no-new-symbol": "error", - "no-nonoctal-decimal-escape": "error", - "no-obj-calls": "error", - "no-octal": "error", - "no-prototype-builtins": "error", - "no-redeclare": "error", - "no-regex-spaces": "error", - "no-self-assign": "error", - "no-setter-return": "error", - "no-shadow-restricted-names": "error", - "no-sparse-arrays": "error", - "no-this-before-super": "error", - "no-undef": "error", - "no-unexpected-multiline": "error", - "no-unreachable": "error", - "no-unsafe-finally": "error", - "no-unsafe-negation": "error", - "no-unsafe-optional-chaining": "error", - "no-unused-labels": "error", - "no-unused-vars": "error", - "no-useless-backreference": "error", - "no-useless-catch": "error", - "no-useless-escape": "error", - "no-with": "error", - "object-shorthand": "error", - "prefer-arrow-callback": "error", - "require-yield": "error", - "use-isnan": "error", - "valid-typeof": "error", - }, - }, - { - "name": "jimmy.codes/disabled", - "rules": { - "@babel/object-curly-spacing": "off", - "@babel/semi": "off", - "@typescript-eslint/block-spacing": "off", - "@typescript-eslint/brace-style": "off", - "@typescript-eslint/comma-dangle": "off", - "@typescript-eslint/comma-spacing": "off", - "@typescript-eslint/func-call-spacing": "off", - "@typescript-eslint/indent": "off", - "@typescript-eslint/key-spacing": "off", - "@typescript-eslint/keyword-spacing": "off", - "@typescript-eslint/lines-around-comment": 0, - "@typescript-eslint/member-delimiter-style": "off", - "@typescript-eslint/no-extra-parens": "off", - "@typescript-eslint/no-extra-semi": "off", - "@typescript-eslint/object-curly-spacing": "off", - "@typescript-eslint/quotes": 0, - "@typescript-eslint/semi": "off", - "@typescript-eslint/space-before-blocks": "off", - "@typescript-eslint/space-before-function-paren": "off", - "@typescript-eslint/space-infix-ops": "off", - "@typescript-eslint/type-annotation-spacing": "off", - "array-bracket-newline": "off", - "array-bracket-spacing": "off", - "array-element-newline": "off", - "arrow-parens": "off", - "arrow-spacing": "off", - "babel/object-curly-spacing": "off", - "babel/quotes": 0, - "babel/semi": "off", - "block-spacing": "off", - "brace-style": "off", - "comma-dangle": "off", - "comma-spacing": "off", - "comma-style": "off", - "computed-property-spacing": "off", - "curly": 0, - "dot-location": "off", - "eol-last": "off", - "flowtype/boolean-style": "off", - "flowtype/delimiter-dangle": "off", - "flowtype/generic-spacing": "off", - "flowtype/object-type-curly-spacing": "off", - "flowtype/object-type-delimiter": "off", - "flowtype/quotes": "off", - "flowtype/semi": "off", - "flowtype/space-after-type-colon": "off", - "flowtype/space-before-generic-bracket": "off", - "flowtype/space-before-type-colon": "off", - "flowtype/union-intersection-spacing": "off", - "func-call-spacing": "off", - "function-call-argument-newline": "off", - "function-paren-newline": "off", - "generator-star": "off", - "generator-star-spacing": "off", - "implicit-arrow-linebreak": "off", - "indent": "off", - "indent-legacy": "off", - "jsx-quotes": "off", - "key-spacing": "off", - "keyword-spacing": "off", - "linebreak-style": "off", - "lines-around-comment": 0, - "max-len": 0, - "max-statements-per-line": "off", - "multiline-ternary": "off", - "new-parens": "off", - "newline-per-chained-call": "off", - "no-arrow-condition": "off", - "no-comma-dangle": "off", - "no-confusing-arrow": 0, - "no-extra-parens": "off", - "no-extra-semi": "off", - "no-floating-decimal": "off", - "no-mixed-operators": 0, - "no-mixed-spaces-and-tabs": "off", - "no-multi-spaces": "off", - "no-multiple-empty-lines": "off", - "no-reserved-keys": "off", - "no-space-before-semi": "off", - "no-spaced-func": "off", - "no-tabs": 0, - "no-trailing-spaces": "off", - "no-unexpected-multiline": 0, - "no-whitespace-before-property": "off", - "no-wrap-func": "off", - "nonblock-statement-body-position": "off", - "object-curly-newline": "off", - "object-curly-spacing": "off", - "object-property-newline": "off", - "one-var-declaration-per-line": "off", - "operator-linebreak": "off", - "padded-blocks": "off", - "quote-props": "off", - "quotes": 0, - "react/jsx-child-element-spacing": "off", - "react/jsx-closing-bracket-location": "off", - "react/jsx-closing-tag-location": "off", - "react/jsx-curly-newline": "off", - "react/jsx-curly-spacing": "off", - "react/jsx-equals-spacing": "off", - "react/jsx-first-prop-new-line": "off", - "react/jsx-indent": "off", - "react/jsx-indent-props": "off", - "react/jsx-max-props-per-line": "off", - "react/jsx-newline": "off", - "react/jsx-one-expression-per-line": "off", - "react/jsx-props-no-multi-spaces": "off", - "react/jsx-space-before-closing": "off", - "react/jsx-tag-spacing": "off", - "react/jsx-wrap-multilines": "off", - "rest-spread-spacing": "off", - "semi": "off", - "semi-spacing": "off", - "semi-style": "off", - "space-after-function-name": "off", - "space-after-keywords": "off", - "space-before-blocks": "off", - "space-before-function-paren": "off", - "space-before-function-parentheses": "off", - "space-before-keywords": "off", - "space-in-brackets": "off", - "space-in-parens": "off", - "space-infix-ops": "off", - "space-return-throw-case": "off", - "space-unary-ops": "off", - "space-unary-word-ops": "off", - "standard/array-bracket-even-spacing": "off", - "standard/computed-property-even-spacing": "off", - "standard/object-curly-even-spacing": "off", - "switch-colon-spacing": "off", - "template-curly-spacing": "off", - "template-tag-spacing": "off", - "unicorn/empty-brace-spaces": "off", - "unicorn/no-nested-ternary": "off", - "unicorn/number-literal-case": "off", - "unicorn/template-indent": 0, - "vue/array-bracket-newline": "off", - "vue/array-bracket-spacing": "off", - "vue/array-element-newline": "off", - "vue/arrow-spacing": "off", - "vue/block-spacing": "off", - "vue/block-tag-newline": "off", - "vue/brace-style": "off", - "vue/comma-dangle": "off", - "vue/comma-spacing": "off", - "vue/comma-style": "off", - "vue/dot-location": "off", - "vue/func-call-spacing": "off", - "vue/html-closing-bracket-newline": "off", - "vue/html-closing-bracket-spacing": "off", - "vue/html-end-tags": "off", - "vue/html-indent": "off", - "vue/html-quotes": "off", - "vue/html-self-closing": 0, - "vue/key-spacing": "off", - "vue/keyword-spacing": "off", - "vue/max-attributes-per-line": "off", - "vue/max-len": 0, - "vue/multiline-html-element-content-newline": "off", - "vue/multiline-ternary": "off", - "vue/mustache-interpolation-spacing": "off", - "vue/no-extra-parens": "off", - "vue/no-multi-spaces": "off", - "vue/no-spaces-around-equal-signs-in-attribute": "off", - "vue/object-curly-newline": "off", - "vue/object-curly-spacing": "off", - "vue/object-property-newline": "off", - "vue/operator-linebreak": "off", - "vue/quote-props": "off", - "vue/script-indent": "off", - "vue/singleline-html-element-content-newline": "off", - "vue/space-in-parens": "off", - "vue/space-infix-ops": "off", - "vue/space-unary-ops": "off", - "vue/template-curly-spacing": "off", - "wrap-iife": "off", - "wrap-regex": "off", - "yield-star-spacing": "off", - }, - }, - { - "ignores": [ - "**/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", - ], - }, -] -`; - exports[`jimmyDotCodes > should create default configuration 1`] = ` [ { diff --git a/src/factory.spec.ts b/src/factory.spec.ts index dc5ef50..79fdf6b 100644 --- a/src/factory.spec.ts +++ b/src/factory.spec.ts @@ -15,10 +15,6 @@ describe("jimmyDotCodes", () => { expect(jimmyDotCodes({ react: true })).toMatchSnapshot(); }); - it("should create configuration w/o imports", () => { - expect(jimmyDotCodes({ imports: false })).toMatchSnapshot(); - }); - it("should create configuration w/ jest", () => { expect(jimmyDotCodes({ testing: { framework: "jest" } })).toMatchSnapshot(); }); diff --git a/src/factory.ts b/src/factory.ts index 67dab0a..fa7c8c4 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -12,13 +12,12 @@ import { getTestingOptions, getTypescriptOptions } from "./utils"; export const jimmyDotCodes = ({ typescript = false, react = false, - imports = true, testing = false, overrides = [], }: Options = {}) => { return [ { name: "jimmy.codes/base", rules: baseRules }, - ...(imports ? importsConfig({ typescript }) : []), + ...importsConfig({ typescript }), ...(typescript ? typescriptConfig(getTypescriptOptions(typescript)) : []), ...(react ? reactConfig() : []), ...(testing ? testingConfig(getTestingOptions(testing)) : []), diff --git a/src/types.ts b/src/types.ts index d0d74c2..09bd7f2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -35,11 +35,6 @@ export interface Options { * @default false */ react?: boolean; - /** - * Are imports rules are enabled? - * @default true - */ - imports?: boolean; /** * Are Jest rules are enabled? * @default false