eslint / create-config

Utility to create ESLint config files
MIT License
76 stars 19 forks source link

Consider removing the TS style guides #101

Closed aladdin-add closed 6 months ago

aladdin-add commented 7 months ago

Initially, there were 4 ts style guides listed:

However, aribnb and google were later removed (due to unofficial TS support), and recently, eslint-conifg-standard-with-typescript has been deprecated. Therefore, I suggest skipping the question "Does your project use TypeScript?" when users choose using a style guide. Instead, recommend using --config to apply a ts styleguide.

related:

aladdin-add commented 6 months ago

ping @eslint/eslint-team

nzakas commented 6 months ago

At this point, I think we should just remove all of the style guides from this wizard. We should be pushing people towards using code formatters anyway.

mdjermanovic commented 6 months ago

Style guides include a lot of rules that are not covered by code formatters.

For example, airbnb-base enables 94 core rules that are not formatting rules and not already included in js.configs.recommended (former eslint:recommended) + 23 eslint-plugin-import rules:

[
    "array-callback-return",
    "arrow-body-style",
    "block-scoped-var",
    "camelcase",
    "class-methods-use-this",
    "consistent-return",
    "curly",
    "default-case",
    "default-case-last",
    "default-param-last",
    "dot-notation",
    "eqeqeq",
    "func-names",
    "grouped-accessor-pairs",
    "guard-for-in",
    "import/export",
    "import/extensions",
    "import/first",
    "import/named",
    "import/newline-after-import",
    "import/no-absolute-path",
    "import/no-amd",
    "import/no-cycle",
    "import/no-duplicates",
    "import/no-dynamic-require",
    "import/no-extraneous-dependencies",
    "import/no-import-module-exports",
    "import/no-mutable-exports",
    "import/no-named-as-default",
    "import/no-named-as-default-member",
    "import/no-named-default",
    "import/no-relative-packages",
    "import/no-self-import",
    "import/no-unresolved",
    "import/no-useless-path-segments",
    "import/no-webpack-loader-syntax",
    "import/order",
    "import/prefer-default-export",
    "max-classes-per-file",
    "new-cap",
    "no-alert",
    "no-array-constructor",
    "no-await-in-loop",
    "no-bitwise",
    "no-caller",
    "no-console",
    "no-constructor-return",
    "no-continue",
    "no-else-return",
    "no-empty-function",
    "no-eval",
    "no-extend-native",
    "no-extra-bind",
    "no-extra-label",
    "no-implied-eval",
    "no-inner-declarations",
    "no-iterator",
    "no-label-var",
    "no-labels",
    "no-lone-blocks",
    "no-lonely-if",
    "no-loop-func",
    "no-multi-assign",
    "no-multi-str",
    "no-nested-ternary",
    "no-new",
    "no-new-func",
    "no-new-wrappers",
    "no-octal-escape",
    "no-param-reassign",
    "no-plusplus",
    "no-promise-executor-return",
    "no-proto",
    "no-restricted-exports",
    "no-restricted-globals",
    "no-restricted-properties",
    "no-restricted-syntax",
    "no-return-assign",
    "no-script-url",
    "no-self-compare",
    "no-sequences",
    "no-shadow",
    "no-template-curly-in-string",
    "no-throw-literal",
    "no-undef-init",
    "no-underscore-dangle",
    "no-unneeded-ternary",
    "no-unreachable-loop",
    "no-unused-expressions",
    "no-use-before-define",
    "no-useless-computed-key",
    "no-useless-concat",
    "no-useless-constructor",
    "no-useless-rename",
    "no-useless-return",
    "no-var",
    "no-void",
    "object-shorthand",
    "one-var",
    "operator-assignment",
    "prefer-arrow-callback",
    "prefer-const",
    "prefer-destructuring",
    "prefer-exponentiation-operator",
    "prefer-numeric-literals",
    "prefer-object-spread",
    "prefer-promise-reject-errors",
    "prefer-regex-literals",
    "prefer-rest-params",
    "prefer-spread",
    "prefer-template",
    "radix",
    "strict",
    "symbol-description",
    "unicode-bom",
    "vars-on-top",
    "yoda"
]
aladdin-add commented 6 months ago

Yes, but users can use --conifg, which should meet most needs.

mdjermanovic commented 6 months ago

Yeah, I'm not opposed to removing style guides from the wizard, just wanted to note that I don't think formatting is a very strong argument because what we call "style guides" are configs that can include much more than just formatting rules.

I support removing all style guides from the wizard because the predefined list is somewhat arbitrary, and we now have the --config option.

nzakas commented 6 months ago

At the time, the list was made up of the most popular style guides that were encoded with ESLint configs. We've not kept up that list, and many have used to source formatters instead. That's why I think it's a good idea to just remove this question. People can always add in whatever they want after the fact.

mdjermanovic commented 6 months ago

Agreed, marked as accepted.