Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

annacv
Copy link
Contributor

@annacv annacv commented Aug 30, 2023

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-components
run npm run lint and check:

  • It should ignore long urls in vue files
  • It should ignore long classes, for example line 331 in Home.vue
  • It should ignore icon files as ‘user-filled.vue’

@annacv annacv requested a review from a team as a code owner August 30, 2023 13:30
Copy link
Contributor

@herrardo herrardo left a 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

image

'vue/max-len': [
'error',
{
ignorePattern: '|class=".*"$ |https://github',
Copy link
Contributor Author

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.

Comment on lines -15 to -26
files: 'src/**/*.vue',
rules: {
'max-len': [
'error',
{
code: 100,
ignoreComments: false,
ignorePattern: '|class=".*"$ |https://github'
}
]
}
},
Copy link
Contributor Author

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.

Comment on lines -27 to -28
{
files: 'src/components/icons/*.vue',
Copy link
Contributor Author

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
@annacv annacv force-pushed the feature/EMP-1907-Support-max-len branch from d7086ff to 97ad5cf Compare September 1, 2023 05:53
Comment on lines 16 to 18
rules: {
'max-len': 'off'
}
Copy link
Contributor Author

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

@annacv
Copy link
Contributor Author

annacv commented Sep 1, 2023

This config seems not to be working properly

@annacv annacv closed this Sep 1, 2023
@diegopf diegopf deleted the feature/EMP-1907-Support-max-len branch September 6, 2023 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: support max-len in Vue components
2 participants