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

chore: promote Prettier warnings to errors in CI and format all files #292

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 14 additions & 58 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"projectName": "svelte-testing-library",
"projectOwner": "testing-library",
"repoType": "github",
"files": [
"README.md"
],
"files": ["README.md"],
"imageSize": 100,
"commit": false,
"contributors": [
Expand All @@ -13,133 +11,91 @@
"name": "Ben Monro",
"avatar_url": "https://avatars3.githubusercontent.com/u/399236?v=4",
"profile": "https://github.com/benmonro",
"contributions": [
"code",
"test",
"ideas",
"doc"
]
"contributions": ["code", "test", "ideas", "doc"]
},
{
"login": "EmilTholin",
"name": "Emil Tholin",
"avatar_url": "https://avatars0.githubusercontent.com/u/11573167?v=4",
"profile": "https://twitter.com/EmilTholin",
"contributions": [
"code",
"test",
"ideas"
]
"contributions": ["code", "test", "ideas"]
},
{
"login": "oieduardorabelo",
"name": "Eduardo Rabelo",
"avatar_url": "https://avatars1.githubusercontent.com/u/829902?v=4",
"profile": "https://medium.com/@oieduardorabelo",
"contributions": [
"test",
"code",
"doc",
"example"
]
"contributions": ["test", "code", "doc", "example"]
},
{
"login": "timdeschryver",
"name": "Tim Deschryver",
"avatar_url": "https://avatars1.githubusercontent.com/u/28659384?v=4",
"profile": "http://timdeschryver.dev",
"contributions": [
"doc"
]
"contributions": ["doc"]
},
{
"login": "ematipico",
"name": "Emanuele",
"avatar_url": "https://avatars3.githubusercontent.com/u/602478?v=4",
"profile": "http://www.ematipico.com",
"contributions": [
"code",
"test",
"doc"
]
"contributions": ["code", "test", "doc"]
},
{
"login": "pngwn",
"name": "pngwn",
"avatar_url": "https://avatars1.githubusercontent.com/u/12937446?v=4",
"profile": "https://github.com/pngwn",
"contributions": [
"code",
"test"
]
"contributions": ["code", "test"]
},
{
"login": "eps1lon",
"name": "Sebastian Silbermann",
"avatar_url": "https://avatars3.githubusercontent.com/u/12292047?v=4",
"profile": "https://twitter.com/sebsilbermann",
"contributions": [
"code"
]
"contributions": ["code"]
},
{
"login": "mihar-22",
"name": "Rahim Alwer",
"avatar_url": "https://avatars3.githubusercontent.com/u/14304599?s=460&v=4",
"profile": "https://github.com/mihar-22",
"contributions": [
"code",
"doc",
"test",
"review"
]
"contributions": ["code", "doc", "test", "review"]
},
{
"login": "MirrorBytes",
"name": "Bob",
"avatar_url": "https://avatars3.githubusercontent.com/u/22119469?v=4",
"profile": "https://github.com/MirrorBytes",
"contributions": [
"bug",
"code"
]
"contributions": ["bug", "code"]
},
{
"login": "ronmerkin",
"name": "Ron Merkin",
"avatar_url": "https://avatars.githubusercontent.com/u/17492527?v=4",
"profile": "https://github.com/ronmerkin",
"contributions": [
"code"
]
"contributions": ["code"]
},
{
"login": "benmccann",
"name": "Ben McCann",
"avatar_url": "https://avatars.githubusercontent.com/u/322311?v=4",
"profile": "http://www.benmccann.com",
"contributions": [
"test"
]
"contributions": ["test"]
},
{
"login": "jgbowser",
"name": "John Bowser",
"avatar_url": "https://avatars.githubusercontent.com/u/66637570?v=4",
"profile": "https://johnbowser.dev/",
"contributions": [
"code",
"test"
]
"contributions": ["code", "test"]
},
{
"login": "ysitbon",
"name": "Yoann",
"avatar_url": "https://avatars.githubusercontent.com/u/1370679?v=4",
"profile": "https://github.com/ysitbon",
"contributions": [
"code"
]
"contributions": ["code"]
}
],
"contributorsPerLine": 7,
Expand Down
46 changes: 23 additions & 23 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: husky
versions:
- 5.0.9
- 5.1.0
- 5.1.1
- 5.1.2
- 5.1.3
- 5.2.0
- dependency-name: "@commitlint/config-conventional"
versions:
- 12.0.0
- 12.0.1
- dependency-name: "@commitlint/cli"
versions:
- 12.0.0
- 12.0.1
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '10:00'
open-pull-requests-limit: 10
ignore:
- dependency-name: husky
versions:
- 5.0.9
- 5.1.0
- 5.1.1
- 5.1.2
- 5.1.3
- 5.2.0
- dependency-name: '@commitlint/config-conventional'
versions:
- 12.0.0
- 12.0.1
- dependency-name: '@commitlint/cli'
versions:
- 12.0.0
- 12.0.1
2 changes: 1 addition & 1 deletion .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Lint PR"
name: 'Lint PR'

on:
pull_request_target:
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ trailingComma: es5
plugins:
- prettier-plugin-svelte
overrides:
- files: "*.svelte"
- files: '*.svelte'
options:
parser: svelte
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [The Problem](#the-problem)
- [This Solution](#this-solution)
- [Installation](#installation)
Expand Down Expand Up @@ -119,23 +118,25 @@ Thanks goes to these people ([emoji key][emojis]):
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/benmonro"><img src="https://avatars3.githubusercontent.com/u/399236?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ben Monro</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=benmonro" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=benmonro" title="Tests">⚠️</a> <a href="#ideas-benmonro" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=benmonro" title="Documentation">📖</a></td>
<td align="center"><a href="https://twitter.com/EmilTholin"><img src="https://avatars0.githubusercontent.com/u/11573167?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Emil Tholin</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=EmilTholin" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=EmilTholin" title="Tests">⚠️</a> <a href="#ideas-EmilTholin" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://medium.com/@oieduardorabelo"><img src="https://avatars1.githubusercontent.com/u/829902?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Eduardo Rabelo</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=oieduardorabelo" title="Tests">⚠️</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=oieduardorabelo" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=oieduardorabelo" title="Documentation">📖</a> <a href="#example-oieduardorabelo" title="Examples">💡</a></td>
<td align="center"><a href="http://timdeschryver.dev"><img src="https://avatars1.githubusercontent.com/u/28659384?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tim Deschryver</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=timdeschryver" title="Documentation">📖</a></td>
<td align="center"><a href="http://www.ematipico.com"><img src="https://avatars3.githubusercontent.com/u/602478?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Emanuele</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=ematipico" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=ematipico" title="Tests">⚠️</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=ematipico" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/pngwn"><img src="https://avatars1.githubusercontent.com/u/12937446?v=4?s=100" width="100px;" alt=""/><br /><sub><b>pngwn</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=pngwn" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=pngwn" title="Tests">⚠️</a></td>
<td align="center"><a href="https://twitter.com/sebsilbermann"><img src="https://avatars3.githubusercontent.com/u/12292047?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sebastian Silbermann</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=eps1lon" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/mihar-22"><img src="https://avatars3.githubusercontent.com/u/14304599?s=460&v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rahim Alwer</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=mihar-22" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=mihar-22" title="Documentation">📖</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=mihar-22" title="Tests">⚠️</a> <a href="https://github.com/testing-library/svelte-testing-library/pulls?q=is%3Apr+reviewed-by%3Amihar-22" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/MirrorBytes"><img src="https://avatars3.githubusercontent.com/u/22119469?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bob</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/issues?q=author%3AMirrorBytes" title="Bug reports">🐛</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=MirrorBytes" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ronmerkin"><img src="https://avatars.githubusercontent.com/u/17492527?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ron Merkin</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=ronmerkin" title="Code">💻</a></td>
<td align="center"><a href="http://www.benmccann.com"><img src="https://avatars.githubusercontent.com/u/322311?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ben McCann</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=benmccann" title="Tests">⚠️</a></td>
<td align="center"><a href="https://johnbowser.dev/"><img src="https://avatars.githubusercontent.com/u/66637570?v=4?s=100" width="100px;" alt=""/><br /><sub><b>John Bowser</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=jgbowser" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=jgbowser" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/ysaskia"><img src="https://avatars.githubusercontent.com/u/1370679?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yoann</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=ysaskia" title="Code">💻</a></td>
</tr>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/benmonro"><img src="https://avatars3.githubusercontent.com/u/399236?v=4?s=100" width="100px;" alt="Ben Monro"/><br /><sub><b>Ben Monro</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=benmonro" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=benmonro" title="Tests">⚠️</a> <a href="#ideas-benmonro" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=benmonro" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://twitter.com/EmilTholin"><img src="https://avatars0.githubusercontent.com/u/11573167?v=4?s=100" width="100px;" alt="Emil Tholin"/><br /><sub><b>Emil Tholin</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=EmilTholin" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=EmilTholin" title="Tests">⚠️</a> <a href="#ideas-EmilTholin" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://medium.com/@oieduardorabelo"><img src="https://avatars1.githubusercontent.com/u/829902?v=4?s=100" width="100px;" alt="Eduardo Rabelo"/><br /><sub><b>Eduardo Rabelo</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=oieduardorabelo" title="Tests">⚠️</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=oieduardorabelo" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=oieduardorabelo" title="Documentation">📖</a> <a href="#example-oieduardorabelo" title="Examples">💡</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://timdeschryver.dev"><img src="https://avatars1.githubusercontent.com/u/28659384?v=4?s=100" width="100px;" alt="Tim Deschryver"/><br /><sub><b>Tim Deschryver</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=timdeschryver" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.ematipico.com"><img src="https://avatars3.githubusercontent.com/u/602478?v=4?s=100" width="100px;" alt="Emanuele"/><br /><sub><b>Emanuele</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=ematipico" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=ematipico" title="Tests">⚠️</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=ematipico" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pngwn"><img src="https://avatars1.githubusercontent.com/u/12937446?v=4?s=100" width="100px;" alt="pngwn"/><br /><sub><b>pngwn</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=pngwn" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=pngwn" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://twitter.com/sebsilbermann"><img src="https://avatars3.githubusercontent.com/u/12292047?v=4?s=100" width="100px;" alt="Sebastian Silbermann"/><br /><sub><b>Sebastian Silbermann</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=eps1lon" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mihar-22"><img src="https://avatars3.githubusercontent.com/u/14304599?s=460&v=4?s=100" width="100px;" alt="Rahim Alwer"/><br /><sub><b>Rahim Alwer</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=mihar-22" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=mihar-22" title="Documentation">📖</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=mihar-22" title="Tests">⚠️</a> <a href="https://github.com/testing-library/svelte-testing-library/pulls?q=is%3Apr+reviewed-by%3Amihar-22" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/MirrorBytes"><img src="https://avatars3.githubusercontent.com/u/22119469?v=4?s=100" width="100px;" alt="Bob"/><br /><sub><b>Bob</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/issues?q=author%3AMirrorBytes" title="Bug reports">🐛</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=MirrorBytes" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ronmerkin"><img src="https://avatars.githubusercontent.com/u/17492527?v=4?s=100" width="100px;" alt="Ron Merkin"/><br /><sub><b>Ron Merkin</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=ronmerkin" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.benmccann.com"><img src="https://avatars.githubusercontent.com/u/322311?v=4?s=100" width="100px;" alt="Ben McCann"/><br /><sub><b>Ben McCann</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=benmccann" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://johnbowser.dev/"><img src="https://avatars.githubusercontent.com/u/66637570?v=4?s=100" width="100px;" alt="John Bowser"/><br /><sub><b>John Bowser</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=jgbowser" title="Code">💻</a> <a href="https://github.com/testing-library/svelte-testing-library/commits?author=jgbowser" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ysitbon"><img src="https://avatars.githubusercontent.com/u/1370679?v=4?s=100" width="100px;" alt="Yoann"/><br /><sub><b>Yoann</b></sub></a><br /><a href="https://github.com/testing-library/svelte-testing-library/commits?author=ysitbon" title="Code">💻</a></td>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
Expand Down Expand Up @@ -187,4 +188,3 @@ Contributions of any kind welcome!
[stackoverflow]: https://stackoverflow.com/questions/tagged/svelte-testing-library

<!-- prettier-ignore-end -->

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
],
"scripts": {
"toc": "doctoc README.md",
"lint": "(prettier . --check || true) && eslint .",
"lint": "prettier . --check && eslint .",
"format": "prettier . --write && eslint . --fix",
"test": "vitest run --coverage",
"test:watch": "vitest",
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/act.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ describe('act', () => {

const render = () => {
return stlRender(Comp, {
props
props,
})
}

beforeEach(() => {
props = {
name: 'World'
name: 'World',
}
})

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/debug.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Comp from './fixtures/Comp.svelte'

describe('debug', () => {
beforeEach(() => {
vi.spyOn(console, 'log').mockImplementation(() => { })
vi.spyOn(console, 'log').mockImplementation(() => {})
})

afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/events.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('events', () => {
button,
new MouseEvent('click', {
bubbles: true,
cancelable: true
cancelable: true,
})
)

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/fixtures/Comp.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const contextName = getContext('name')

function handleClick () {
function handleClick() {
buttonText = 'Button Clicked'
}
</script>
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/fixtures/Comp2.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

let buttonText = 'Button Text'

function handleClick () {
function handleClick() {
buttonText = 'Button Clicked'
}
</script>

<style></style>

<h1>Hello {name}!</h1>

<button on:click={handleClick}>{buttonText}</button>

<style></style>
Loading
Loading