Skip to content

Commit 22e380a

Browse files
committed
ci: enable CI tools and linters
close #166
1 parent 931c062 commit 22e380a

35 files changed

+242
-92
lines changed

.browserslistrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends @1stg/browserslist-config/modern

.changeset/README.md

Lines changed: 8 additions & 0 deletions
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

Lines changed: 15 additions & 0 deletions
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

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

.commitlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@1stg"
3+
}

.eslintignore

Lines changed: 1 addition & 0 deletions
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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ module.exports = {
1515
"plugin:@ota-meshi/+eslint-plugin",
1616
"plugin:@ota-meshi/+package-json",
1717
"plugin:@ota-meshi/+json",
18-
"plugin:@ota-meshi/+yaml",
1918
"plugin:@ota-meshi/+md",
19+
"plugin:@ota-meshi/+yaml",
2020
"plugin:@ota-meshi/+prettier",
2121
],
2222
rules: {
@@ -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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 37 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 7 additions & 0 deletions
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

Lines changed: 15 additions & 0 deletions
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

Lines changed: 61 additions & 58 deletions
Large diffs are not rendered by default.

docs/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ title: "eslint-plugin-svelte"
44

55
# Introduction
66

7-
`eslint-plugin-svelte` is [ESLint] plugin for [Svelte].
8-
It provides many unique check rules by using the template AST.
7+
`eslint-plugin-svelte` is [ESLint] plugin for [Svelte].\
8+
It provides many unique check rules by using the template AST.\
99
You can check on the [Online DEMO](./playground.md).
1010

1111
[![NPM license](https://img.shields.io/npm/l/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
1212
[![NPM version](https://img.shields.io/npm/v/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
13-
[![NPM downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&colorB=green&suffix=/day&query=$.downloads&uri=https://api.npmjs.org//downloads/point/last-day/eslint-plugin-svelte&maxAge=3600)](http://www.npmtrends.com/eslint-plugin-svelte)
13+
[![NPM downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads\&colorB=green\&suffix=/day\&query=$.downloads\&uri=https://api.npmjs.org//downloads/point/last-day/eslint-plugin-svelte\&maxAge=3600)](http://www.npmtrends.com/eslint-plugin-svelte)
1414
[![NPM downloads](https://img.shields.io/npm/dw/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
1515
[![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
1616
[![NPM downloads](https://img.shields.io/npm/dy/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
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-
## :name_badge: What is this plugin?
20+
## :name\_badge: What is this plugin?
2121

22-
[ESLint] plugin for [Svelte].
22+
[ESLint] plugin for [Svelte].\
2323
It provides many unique check rules using the AST generated by [svelte-eslint-parser].
2424

2525
### ❓ Why?
@@ -39,7 +39,7 @@ The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with t
3939

4040
See [User Guide](./user-guide.md).
4141

42-
## :white_check_mark: Rules
42+
## :white\_check\_mark: Rules
4343

4444
See [Available Rules](./rules.md).
4545

docs/migration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ If you want the previous behavior, replace it with [eslint-plugin-svelte3].
1010

1111
## From `@ota-meshi/eslint-plugin-svelte`
1212

13-
`@ota-meshi/eslint-plugin-svelte` has been renamed to `eslint-plugin-svelte`.
13+
`@ota-meshi/eslint-plugin-svelte` has been renamed to `eslint-plugin-svelte`.\
1414
Therefore, you need to replace the package name, and the presets, rules, and settings specified in the configuration.
1515

16-
- `package.json`
16+
- `package.json`\
1717
Replace the package name.
1818

1919
```diff
2020
- "@ota-meshi/eslint-plugin-svelte": "^0.X.X"
2121
+ "eslint-plugin-svelte": "^X.X.X"
2222
```
2323

24-
- `.eslintrc.*`
25-
Replace `@ota-meshi/svelte` with `svelte` as a string.
24+
- `.eslintrc.*`\
25+
Replace `@ota-meshi/svelte` with `svelte` as a string.\
2626
Examples:
2727

2828
- Presets

docs/rules/first-attribute-linebreak.md

Lines changed: 1 addition & 0 deletions
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-extra-reactive-curlies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Nothing.
4242

4343
## :heart: Compatibility
4444

45-
This rule was taken from [@tivac/eslint-plugin-svelte].
45+
This rule was taken from [@tivac/eslint-plugin-svelte].\
4646
This rule is compatible with `@tivac/svelte/reactive-curlies` rule.
4747

4848
[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/

docs/rules/no-inner-declarations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ since: "v0.0.8"
1616

1717
This rule requires that function declarations and, optionally, variable declarations be in the root of a program or the body of a function.
1818

19-
This rule extends the base ESLint's [no-inner-declarations] rule. The AST generated by [svelte-eslint-parser] will false positives in [no-inner-declarations] rule because the root node of the script is not the `Program`.
19+
This rule extends the base ESLint's [no-inner-declarations] rule. The AST generated by [svelte-eslint-parser] will false positives in [no-inner-declarations] rule because the root node of the script is not the `Program`.\
2020
This rule supports [svelte-eslint-parser]'s AST.
2121

2222
[svelte-eslint-parser]: https://github.com/ota-meshi/svelte-eslint-parser

docs/rules/no-not-function-handler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ since: "v0.5.0"
1414

1515
## :book: Rule Details
1616

17-
This rule reports where you used not function value in event handlers.
17+
This rule reports where you used not function value in event handlers.\
1818
If you use a non-function value for the event handler, it event handler will not be called. It's almost always a mistake. You may have written a lot of unnecessary curly braces.
1919

2020
<ESLintCodeBlock>

docs/rules/no-object-in-text-mustaches.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ since: "v0.5.0"
1414

1515
## :book: Rule Details
1616

17-
This rule disallows the use of objects in text mustache interpolation.
17+
This rule disallows the use of objects in text mustache interpolation.\
1818
When you use an object for text interpolation, it is drawn as `[object Object]`. It's almost always a mistake. You may have written a lot of unnecessary curly braces.
1919

2020
<ESLintCodeBlock>

docs/rules/no-reactive-functions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ Nothing
4242

4343
## :heart: Compatibility
4444

45-
This rule was taken from [@tivac/eslint-plugin-svelte].
45+
This rule was taken from [@tivac/eslint-plugin-svelte].\
4646
This rule is compatible with `@tivac/svelte/reactive-functions` rule.
4747

4848
[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/
49+
4950
## :rocket: Version
5051

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

docs/rules/no-reactive-literals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Nothing.
3939

4040
## :heart: Compatibility
4141

42-
This rule was taken from [@tivac/eslint-plugin-svelte].
42+
This rule was taken from [@tivac/eslint-plugin-svelte].\
4343
This rule is compatible with `@tivac/svelte/reactive-literals` rule.
4444

4545
[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/

docs/rules/prefer-style-directive.md

Lines changed: 1 addition & 0 deletions
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/require-stores-init.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Nothing.
4242

4343
## :heart: Compatibility
4444

45-
This rule was taken from [@tivac/eslint-plugin-svelte].
45+
This rule was taken from [@tivac/eslint-plugin-svelte].\
4646
This rule is compatible with `@tivac/svelte/stores-initial-value` rule.
4747

4848
[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/

docs/rules/shorthand-attribute.md

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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,13 +134,13 @@ 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

141141
You can change the behavior of this plugin with some settings.
142142

143-
- `ignoreWarnings` (optional) ... Specifies an array of rules that ignore reports in the template.
143+
- `ignoreWarnings` (optional) ... Specifies an array of rules that ignore reports in the template.\
144144
For example, set rules on the template that cannot avoid false positives.
145145
- `compileOptions` (optional) ... Specifies options for Svelte compile. Effects rules that use Svelte compile. The target rules are [svelte/valid-compile](./rules/valid-compile.md) and [svelte/no-unused-svelte-ignore](./rules/no-unused-svelte-ignore.md). **Note that it has no effect on ESLint's custom parser**.
146146
- `postcss` (optional) ... Specifies options related to PostCSS. You can disable the PostCSS process by specifying `false`.

lint-staged.config.js

Lines changed: 3 additions & 0 deletions
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)