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

fix: ignore autogenerated file linting #597

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/core/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ export {}

declare module '@vue/runtime-core' {`

let code = `// generated by unplugin-vue-components
let code = `/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
${head}`
Expand Down
24 changes: 18 additions & 6 deletions test/__snapshots__/dts.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Vitest Snapshot v1

exports[`dts > components only 1`] = `
"// generated by unplugin-vue-components
"/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
Expand All @@ -19,7 +21,9 @@ declare module '@vue/runtime-core' {
`;

exports[`dts > directive only 1`] = `
"// generated by unplugin-vue-components
"/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
Expand All @@ -35,7 +39,9 @@ declare module '@vue/runtime-core' {
`;

exports[`dts > getDeclaration 1`] = `
"// generated by unplugin-vue-components
"/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
Expand Down Expand Up @@ -93,7 +99,9 @@ exports[`dts > parseDeclaration 1`] = `
`;

exports[`dts > vue 2.7 components only 1`] = `
"// generated by unplugin-vue-components
"/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
export {}
Expand All @@ -109,7 +117,9 @@ declare module 'vue' {
`;

exports[`dts > writeDeclaration - keep unused 1`] = `
"// generated by unplugin-vue-components
"/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
Expand All @@ -133,7 +143,9 @@ declare module '@vue/runtime-core' {
`;

exports[`dts > writeDeclaration 1`] = `
"// generated by unplugin-vue-components
"/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
Expand Down
6 changes: 6 additions & 0 deletions test/dts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ const _directive_loading = _resolveDirective("loading")`

test('parseDeclaration', async () => {
const code = `
/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
Expand All @@ -144,6 +146,8 @@ declare module '@vue/runtime-core' {

test('parseDeclaration - has icon component like <IMdi:diceD12>', async () => {
const code = `
/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
Expand All @@ -165,6 +169,8 @@ declare module '@vue/runtime-core' {

test('parseDeclaration - with directives', async () => {
const code = `
/* eslint-disable */
/* prettier-ignore */
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
Expand Down