Skip to content

Conversation

@sethidden
Copy link
Contributor

Continued fixes of eslint, but this time in .vue files.

Turned out that a huge amount of .vue errors were in a file that contained some SVG tags.

AFter this PR, there are 30 errors left - most are about missing lang="ts"

@sethidden sethidden force-pushed the fix-some-vue-linting-errors branch from 2e845c1 to 2d506c6 Compare May 20, 2022 12:48
@sethidden
Copy link
Contributor Author

Added lang="ts" to some more components. There are 17 errors left. Most are lang="ts", but adding lang="ts" obviously makes that one error turn into seven.

@sethidden sethidden force-pushed the fix-some-vue-linting-errors branch from df83867 to 010a2dd Compare May 22, 2022 10:20
const page = ref({});
const page = ref<CmsPage | null>(null);
// eslint-disable-next-line consistent-return
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still required? maybe add return value instead of suppressing linter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://nuxtjs.org/docs/directory-structure/middleware/#named-middleware

Given the example above I don't think there's anything to return. If I add just return the linter will complain about "useless return"

Comment on lines 68 to 69
// eslint-disable-next-line prefer-destructuring
const page : CmsPage = this.page;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// eslint-disable-next-line prefer-destructuring
const page : CmsPage = this.page;
const { page }: CmsPage = this;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, there is something wrong with this type if you destruct the value, is the page really CmsPage?

Copy link
Contributor Author

@sethidden sethidden May 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoided destructuring with type assertion by using a solution from nuxt/typescript (link in commit message)
f182734 (#1036)

@Frodigo Frodigo requested a review from bartoszherba May 23, 2022 07:17
@Frodigo Frodigo added this to the 1.0.0-rc.8 milestone May 23, 2022
@sethidden sethidden force-pushed the fix-some-vue-linting-errors branch from 010a2dd to f182734 Compare May 23, 2022 07:44
@sethidden sethidden merged commit cd4ac09 into develop May 23, 2022
@sethidden sethidden deleted the fix-some-vue-linting-errors branch May 23, 2022 10:43
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.

4 participants