vuejs / eslint-config-typescript

ESLint configuration for Vue 3 + TypeScript projects
MIT License
133 stars 30 forks source link

Integration with ESLint's built-in configurations (`strict-type-checked`, `stylistic-type-checked`) #67

Open undergroundwires opened 11 months ago

undergroundwires commented 11 months ago

Documentation problem on ESLint configurations

The current documentation advises using this config after other plugins. However, it lacks clarity on integrating with ESLint's stricter inbuilt configurations like strict-type-checked or stylistic-type-checked, which exceed the recommended level provided by @vue/typescript/recommended.

Issues with .vue file parsing

Going against the official documentation and adding strict-type-checked and stylistic-type-checked before this config works partly. This is also suggested by @n0099 in issue #29. It allows reusing parser and plugin options but it fails to parse .vue files

So doing something like:

    '@vue/typescript/recommended',

    'plugin:@typescript-eslint/strict-type-checked',
    'plugin:@typescript-eslint/stylistic-type-checked',

Fails on files that are not .ts, such as cjs, js and most importantly .vue files.

Potential solution

I see two steps solution, and would appreciate your input, @sodatea:

  1. Update README.md to offer clear guidance on using these ESLint configurations. Either advise against their use if unsupported, or provide a workaround if possible. The current instruction to use this config after other plugins is unclear and confusing, leading to similar issues on GitHub.
  2. Find a way to support integration with these inbuilt ESLint rules.

Updating documentation can be first step as it could address related issues like #63, #43, #29, and #18, potentially resolving them with an official statement from the maintainers.

n0099 commented 11 months ago

I'm using https://github.com/ota-meshi/typescript-eslint-parser-for-extra-files for now: https://github.com/n0099/open-tbm/commit/3ac89945c462f35f5400bec45fa9e4e1c26622f3