Skip to content

Commit 7c8d053

Browse files
authored
ci: enable CI tools and linters (#220)
1 parent 931c062 commit 7c8d053

29 files changed

+195
-23
lines changed

.browserslistrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends @1stg/browserslist-config/modern

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "ota-meshi/eslint-plugin-svelte"
7+
}
8+
],
9+
"commit": false,
10+
"linked": [],
11+
"access": "restricted",
12+
"baseBranch": "main",
13+
"updateInternalDependencies": "patch",
14+
"ignore": []
15+
}

.codesandbox/ci.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"node": "16",
3+
"sandboxes": []
4+
}

.commitlintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@1stg"
3+
}

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
/build
1717
/docs-svelte-kit/shim/eslint.mjs
1818
/docs-svelte-kit/shim/assert.mjs
19+
!/.*.js

.eslintrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ module.exports = {
3535
],
3636
},
3737
overrides: [
38+
{
39+
files: ["*.md"],
40+
extends: "plugin:mdx/recommended",
41+
settings: {
42+
"mdx/code-blocks": true,
43+
},
44+
},
3845
{
3946
files: ["*.mjs"],
4047
parserOptions: {

.github/workflows/NodeCI.yml

+2
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ jobs:
5353
run: yarn install --ignore-engines
5454
- name: Test
5555
run: yarn test
56+
- name: Type Coverage
57+
run: yarn typecov

.github/workflows/Release.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@v3
15+
with:
16+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
17+
fetch-depth: 0
18+
19+
- name: Setup Node.js 16
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16
23+
24+
- name: Install Dependencies
25+
run: yarn
26+
27+
- name: Create Release Pull Request or Publish to npm
28+
id: changesets
29+
uses: changesets/action@v1
30+
with:
31+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
32+
publish: yarn release
33+
commit: "chore: release eslint-plugin-svelte"
34+
title: "chore: release eslint-plugin-svelte"
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ dist
104104
/yarn.lock
105105
/lib
106106
/.svelte-kit
107+
/.type-coverage
107108
/build
108109
/svelte.config-dist.js
109110
/docs-svelte-kit/shim/eslint.mjs

.remarkrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"plugins": [
3+
"@1stg/remark-config",
4+
["lint-final-definition", false],
5+
["lint-no-shortcut-reference-link", false]
6+
]
7+
}

.stylelintignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.*ignore
2+
.npmrc
3+
LICENSE
4+
*.png
5+
*.json
6+
*.lock
7+
*.log
8+
*.svg
9+
*.yaml
10+
*.yml
11+
/tests/fixtures/rules
12+
# TODO: enable the following
13+
# should we ignore markdown files?
14+
*.md
15+
/docs-svelte-kit/

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ You can check on the [Online DEMO](https://ota-meshi.github.io/eslint-plugin-sve
1313
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
1414
[![Build Status](https://github.com/ota-meshi/eslint-plugin-svelte/workflows/CI/badge.svg?branch=main)](https://github.com/ota-meshi/eslint-plugin-svelte/actions?query=workflow%3ACI)
1515

16+
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/ota-meshi/eslint-plugin-svelte.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ota-meshi/eslint-plugin-svelte/context:javascript)
17+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fota-meshi%2Feslint-plugin-svelte%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
18+
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
19+
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
20+
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
21+
1622
## :name_badge: What is this plugin?
1723

1824
[ESLint] plugin for [Svelte].
@@ -61,7 +67,7 @@ npm install --save-dev eslint eslint-plugin-svelte svelte
6167

6268
### Configuration
6369

64-
Use `.eslintrc.*` file to configure rules. See also: [https://eslint.org/docs/user-guide/configuring](https://eslint.org/docs/user-guide/configuring).
70+
Use `.eslintrc.*` file to configure rules. See also: <https://eslint.org/docs/user-guide/configuring>.
6571

6672
Example **.eslintrc.js**:
6773

@@ -176,7 +182,7 @@ module.exports = {
176182
}
177183
```
178184

179-
See also [https://github.com/ota-meshi/svelte-eslint-parser#readme](https://github.com/ota-meshi/svelte-eslint-parser#readme).
185+
See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.
180186

181187
#### settings.svelte
182188

@@ -242,6 +248,7 @@ Example **.vscode/settings.json**:
242248

243249
## :white_check_mark: Rules
244250

251+
<!-- prettier-ignore-start -->
245252
<!--RULES_SECTION_START-->
246253

247254
:wrench: Indicates that the rule is fixable, and using `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the reported problems.
@@ -330,6 +337,7 @@ These rules relate to this plugin works:
330337

331338
<!--RULES_TABLE_END-->
332339
<!--RULES_SECTION_END-->
340+
<!-- prettier-ignore-end -->
333341

334342
<!--DOCS_IGNORE_START-->
335343

docs/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ You can check on the [Online DEMO](./playground.md).
1717
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
1818
[![Build Status](https://github.com/ota-meshi/eslint-plugin-svelte/workflows/CI/badge.svg?branch=main)](https://github.com/ota-meshi/eslint-plugin-svelte/actions?query=workflow%3ACI)
1919

20+
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/ota-meshi/eslint-plugin-svelte.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ota-meshi/eslint-plugin-svelte/context:javascript)
21+
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fota-meshi%2Feslint-plugin-svelte%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
22+
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
23+
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
24+
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)
25+
2026
## :name_badge: What is this plugin?
2127

2228
[ESLint] plugin for [Svelte].
@@ -41,7 +47,9 @@ See [User Guide](./user-guide.md).
4147

4248
## :white_check_mark: Rules
4349

50+
<!-- prettier-ignore-start -->
4451
See [Available Rules](./rules.md).
52+
<!-- prettier-ignore-end -->
4553

4654
## :lock: License
4755

docs/rules/first-attribute-linebreak.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This rule aims to enforce a consistent location for the first attribute.
1919
<ESLintCodeBlock fix>
2020

2121
<!-- prettier-ignore-start -->
22+
2223
<!--eslint-skip-->
2324

2425
```svelte

docs/rules/no-reactive-functions.md

+14-5
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@ This rule reports whenever a function is defined in a reactive statement. This i
2525
/* eslint svelte/no-reactive-functions: "error" */
2626
2727
/* ✓ GOOD */
28-
const arrowFn = () => { /* ... */ }
29-
const func = function() { /* ... */ }
30-
28+
const arrowFn = () => {
29+
/* ... */
30+
}
31+
const func = function () {
32+
/* ... */
33+
}
34+
3135
/* ✗ BAD */
32-
$: arrowFn = () => { /* ... */ }
33-
$: func = function() { /* ... */ }
36+
$: arrowFn = () => {
37+
/* ... */
38+
}
39+
$: func = function () {
40+
/* ... */
41+
}
3442
</script>
3543
```
3644

@@ -46,6 +54,7 @@ This rule was taken from [@tivac/eslint-plugin-svelte].
4654
This rule is compatible with `@tivac/svelte/reactive-functions` rule.
4755

4856
[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/
57+
4958
## :rocket: Version
5059

5160
This rule was introduced in eslint-plugin-svelte v2.5.0

docs/rules/prefer-style-directive.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Style directive were added in Svelte v3.46.
2121
<ESLintCodeBlock fix>
2222

2323
<!-- prettier-ignore-start -->
24+
2425
<!--eslint-skip-->
2526

2627
```svelte

docs/rules/shorthand-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This rule enforces the use of the shorthand syntax in attribute.
1919
<ESLintCodeBlock fix>
2020

2121
<!-- prettier-ignore-start -->
22+
2223
<!--eslint-skip-->
2324

2425
```svelte

docs/rules/shorthand-directive.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This rule enforces the use of the shorthand syntax in directives.
1919
<ESLintCodeBlock fix>
2020

2121
<!-- prettier-ignore-start -->
22+
2223
<!--eslint-skip-->
2324

2425
```svelte

docs/rules/spaced-html-comment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You cannot enforce this style by using [prettier-plugin-svelte]. That is, this r
4848
```
4949

5050
- `"always"` ... There must be at least one whitespace after `<!--` and before `-->`.
51-
- `"never"` ... There should be no leading or trailing whitespace.  There should be no whitespace following.
51+
- `"never"` ... There should be no leading or trailing whitespace. There should be no whitespace following.
5252

5353
## :rocket: Version
5454

docs/user-guide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ npm install --save-dev eslint eslint-plugin-svelte svelte
1919

2020
### Configuration
2121

22-
Use `.eslintrc.*` file to configure rules. See also: [https://eslint.org/docs/user-guide/configuring](https://eslint.org/docs/user-guide/configuring).
22+
Use `.eslintrc.*` file to configure rules. See also: <https://eslint.org/docs/user-guide/configuring>.
2323

2424
Example **.eslintrc.js**:
2525

@@ -134,7 +134,7 @@ module.exports = {
134134
}
135135
```
136136

137-
See also [https://github.com/ota-meshi/svelte-eslint-parser#readme](https://github.com/ota-meshi/svelte-eslint-parser#readme).
137+
See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.
138138

139139
#### settings.svelte
140140

lint-staged.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"use strict"
2+
3+
module.exports = require("@1stg/lint-staged/tsc")

0 commit comments

Comments
 (0)