-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support max-len in Vue components #1272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the proposal in the issue was correct, it was to add this configuration to the eslint-plugin-x
config, so everybody using that package would be using the new rules.
That would mean to add it here:
https://github.com/empathyco/x/blob/main/packages/eslint-plugin-x/lib/configs/eslint.js
'vue/max-len': [ | ||
'error', | ||
{ | ||
ignorePattern: '|class=".*"$ |https://github', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ignorePattern
config was previously set in x-components' eslint config.
files: 'src/**/*.vue', | ||
rules: { | ||
'max-len': [ | ||
'error', | ||
{ | ||
code: 100, | ||
ignoreComments: false, | ||
ignorePattern: '|class=".*"$ |https://github' | ||
} | ||
] | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are disabling the entire max-len
rule for vue components, in order to use vue/max-len
one, we get rid of this config here.
{ | ||
files: 'src/components/icons/*.vue', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to specify disabling max-len
for icon files, as we are doing it globally
…n that was applied in x-components package config EMP-1907
d7086ff
to
97ad5cf
Compare
rules: { | ||
'max-len': 'off' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only way I found to effectively disable max-len
, I tried in eslint-x plugin file but it didn't have effect
This config seems not to be working properly |
EMP-1908
resolves #1063
Ref issue
TEST
1- Here are some examples for testing
ignoreUrls
,ignoreStrings
,ignoreTemplateLiterals
rules, that can be applied in, for example,Home.vue
2- Run eslint in your project:
run
build eslint-plugin-x
run
pnpm install —frozen-lockfile
in x-componentsrun
npm run lint
and check: