Skip to content

Commit

Permalink
test: add test case for pug files
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Dec 20, 2023
1 parent 5466399 commit 41f5a1e
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"arrowParens": "avoid",
"singleQuote": true,
"plugins": ["prettier-plugin-pkg"]
"plugins": ["@prettier/plugin-pug", "prettier-plugin-pkg"]
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"@eslint-community/eslint-plugin-eslint-comments": "^4.1.0",
"@eslint/js": "^8.55.0",
"@graphql-eslint/eslint-plugin": "^3.20.0",
"@prettier/plugin-pug": "^3.0.0",
"@types/eslint": "^8.44.7",
"@types/prettier-linter-helpers": "^1.0.1",
"commitlint": "^18.4.3",
Expand All @@ -74,6 +75,7 @@
"eslint-plugin-mdx": "^2.2.0",
"eslint-plugin-n": "^16.3.1",
"eslint-plugin-prettier": "link:.",
"eslint-plugin-pug": "^1.2.5",
"eslint-plugin-svelte": "^2.32.2",
"eslint-plugin-svelte3": "^4.0.0",
"graphql": "^16.7.1",
Expand Down
110 changes: 99 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/fixtures/pug.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
script.
a();;;;;;
10 changes: 10 additions & 0 deletions test/prettier.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ const eslint = new ESLint({
files: '**/eslint-plugin-svelte/*.svelte',
extends: ['plugin:svelte/recommended'],
},
{
files: '*.pug',
plugins: ['pug'],
},
],
},
useEslintrc: false,
Expand Down Expand Up @@ -306,6 +310,12 @@ runFixture(
true,
);

/**
* The `script` code style actually does not match `prettier`'s,
* but we are skipping scripts in pug files
*/
runFixture('*.pug', [[]]);

// ------------------------------------------------------------------------------
// Helpers
// ------------------------------------------------------------------------------
Expand Down

0 comments on commit 41f5a1e

Please sign in to comment.