Skip to content

Commit

Permalink
fix: ignore autogenerated file linting (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonkerkola committed Feb 8, 2023
1 parent b652c66 commit f6baed8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
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

0 comments on commit f6baed8

Please sign in to comment.