Skip to content

Commit 6d53ff2

Browse files
committed
Merge branch 'main' into prefer-destructured-store-props
2 parents ca17664 + f3a2c4e commit 6d53ff2

File tree

604 files changed

+20217
-17982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

604 files changed

+20217
-17982
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

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
"bumpVersionsWithWorkspaceProtocolOnly": true,
15+
"ignore": []
16+
}

.codesandbox/ci.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"installCommand": "install-with-ignore-engines",
3+
"node": "16",
4+
"sandboxes": []
5+
}

.commitlintrc.json

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

.env-cmdrc

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"version": {
33
"IN_VERSION_SCRIPT": "true"
4+
},
5+
"version-ci": {
6+
"IN_VERSION_CI_SCRIPT": "true"
7+
},
8+
"debug": {
9+
"DEBUG": "eslint-plugin-svelte*"
410
}
511
}

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111
/tests/fixtures/rules/valid-compile/valid/babel
1212
/tests/fixtures/rules/valid-compile/valid/ts
1313
/tests/fixtures/rules/prefer-style-directive
14+
/tests/fixtures/rules/@typescript-eslint
1415
/.svelte-kit
1516
/svelte.config-dist.js
1617
/build
1718
/docs-svelte-kit/shim/eslint.mjs
1819
/docs-svelte-kit/shim/assert.mjs
20+
!/.*.js
21+
/docs-svelte-kit/src/routes/*.md
22+
/docs-svelte-kit/src/routes/**/*.md

.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/GHPages.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ jobs:
2929
- name: Install And Build
3030
run: |+
3131
yarn install
32+
yarn update
3233
yarn build
3334
export NODE_OPTIONS="--max-old-space-size=8192"
3435
yarn docs:build
3536
- name: Setup Pages
36-
uses: actions/configure-pages@v1
37+
uses: actions/configure-pages@v2
3738
- name: Upload artifact
3839
uses: actions/upload-pages-artifact@v1
3940
with:
40-
path: ./build
41+
path: ./build/eslint-plugin-svelte
4142
- name: Deploy to GitHub Pages
4243
id: deployment
4344
uses: actions/deploy-pages@v1

.github/workflows/NodeCI.yml

+7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ jobs:
4444
uses: actions/setup-node@v3
4545
with:
4646
node-version: ${{ matrix.node }}
47+
- name: Remove @sveltejs/kit # Remove @sveltejs/kit because postinstall fails on old node.
48+
# Use npm because yarn remove needs the lock file.
49+
run: |+
50+
npm uninstall @sveltejs/kit --legacy-peer-deps
51+
rm -rf node_modules
4752
- name: Install ESLint ${{ matrix.eslint }}
4853
run: |+
4954
yarn add -D eslint@${{ matrix.eslint }} --ignore-engines
@@ -53,3 +58,5 @@ jobs:
5358
run: yarn install --ignore-engines
5459
- name: Test
5560
run: yarn test
61+
- name: Type Coverage
62+
run: yarn typecov

.github/workflows/Release.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 npm script called version that runs some logic and then calls `changeset version`.
32+
version: yarn version:ci
33+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
34+
publish: yarn release
35+
commit: "chore: release eslint-plugin-svelte"
36+
title: "chore: release eslint-plugin-svelte"
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+5-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jspm_packages/
5050
# Optional npm cache directory
5151
.npm
5252

53-
# Optional eslint cache
54-
.eslintcache
53+
# Optional eslint/stylelint cache, etc
54+
.*cache
5555

5656
# Microbundle cache
5757
.rpt2_cache/
@@ -104,7 +104,10 @@ 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
110111
/docs-svelte-kit/shim/assert.mjs
112+
/docs-svelte-kit/src/routes/*.md
113+
/docs-svelte-kit/src/routes/**/*.md

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.svelte-kit
2+
.type-coverage
3+
build
4+
/lib

.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/

.vscode/settings.json

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
],
1111
"editor.formatOnSave": true,
1212
"editor.defaultFormatter": "esbenp.prettier-vscode",
13-
"vetur.validation.script": false,
14-
"vetur.validation.style": false,
1513
"editor.codeActionsOnSave": {
1614
"source.fixAll": true,
1715
"source.fixAll.stylelint": true

CHANGELOG.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# eslint-plugin-svelte
2+
3+
## 2.9.0
4+
5+
### Minor Changes
6+
7+
- [#262](https://github.com/ota-meshi/eslint-plugin-svelte/pull/262) [`b732ec6`](https://github.com/ota-meshi/eslint-plugin-svelte/commit/b732ec621b1832ddf214ca3bb556d1c0b9ead463) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: add `svelte/@typescript-eslint/no-unnecessary-condition` rule
8+
9+
### Patch Changes
10+
11+
- [#261](https://github.com/ota-meshi/eslint-plugin-svelte/pull/261) [`3dae5ab`](https://github.com/ota-meshi/eslint-plugin-svelte/commit/3dae5abe1ac9487697784109e31370641efb204f) Thanks [@ota-meshi](https://github.com/ota-meshi)! - fix: false report in `settings.ignoreWarnings`
12+
13+
## 2.8.0
14+
15+
### Minor Changes
16+
17+
- [#249](https://github.com/ota-meshi/eslint-plugin-svelte/pull/249) [`6d0b89f`](https://github.com/ota-meshi/eslint-plugin-svelte/commit/6d0b89f644b160b94293f4f0a63d5cef4bb032e4) Thanks [@baseballyama](https://github.com/baseballyama)! - feat: add `svelte/derived-has-same-inputs-outputs` rule
18+
19+
## 2.7.0
20+
21+
### Minor Changes
22+
23+
- [#240](https://github.com/ota-meshi/eslint-plugin-svelte/pull/240) [`e56fbdb`](https://github.com/ota-meshi/eslint-plugin-svelte/commit/e56fbdb34079567a6c1061909fa7d54cfc91727d) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: add `svelte/no-trailing-spaces` rule
24+
- [#225](https://github.com/ota-meshi/eslint-plugin-svelte/pull/225) [`a3888b3`](https://github.com/ota-meshi/eslint-plugin-svelte/commit/a3888b3cf358ceaa4ddaf22af19f8124d0ff53e4) Thanks [@baseballyama](https://github.com/baseballyama)! - feat: add `svelte/no-store-async` rule
25+
26+
## 2.6.0
27+
28+
### Minor Changes
29+
30+
- [#216](https://github.com/ota-meshi/eslint-plugin-svelte/pull/216) [`9d122ea`](https://github.com/ota-meshi/eslint-plugin-svelte/commit/9d122eaee577ffb846051b7cad15f515dbbb2ccb) Thanks [@marekvospel](https://github.com/marekvospel)! - feat(html-self-closing): add configuration presets

CONTRIBUTING.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Contributing
2+
3+
Thanks for contributing!
4+
5+
## Installation
6+
7+
```sh
8+
git clone https://github.com/ota-meshi/eslint-plugin-svelte.git
9+
cd eslint-plugin-svelte
10+
yarn
11+
```
12+
13+
## Running the tests
14+
15+
```sh
16+
yarn test
17+
```
18+
19+
To run the tests with debugging log, you can use `yarn test:debug`.
20+
21+
This is an [ESLint](http://eslint.org) plugin. Documentation for the APIs that it uses can be found on ESLint's [Working with Plugins](http://eslint.org/docs/developer-guide/working-with-plugins) page.
22+
23+
This plugin is used to lint itself. The style is checked when `yarn lint` is run, and the build will fail if there are any linting errors. You can use `yarn lint-fix` to fix some linting errors.
24+
25+
## Other Development Tools
26+
27+
- `yarn test` runs tests.
28+
- `yarn cover` runs tests and measures coverage.
29+
- `yarn new [new-rule-name]` generate the files needed to implement the new rule.
30+
- `yarn update` runs in order to update readme and recommended configuration.
31+
- `yarn docs:watch` launch the document site in development mode.
32+
33+
## Test the Rule
34+
35+
Rule testing almost always uses fixtures.
36+
For example, for an `indent` rule, the `.ts` file that runs the test is `tests/src/rules/indent.ts` and the fixture is in `tests/fixtures/rules/indent`.
37+
The fixture directory has an `invalid` directory and a `valid` directory.
38+
39+
- The `invalid` directory contains test cases where the rule reports problems.
40+
- The `valid` directory contains test cases where the rule does not report a problem.
41+
42+
The fixture input file should be named `*-input.svelte`. It is automatically collected and tested.
43+
If your test requires configuration, you need to add a json file with the configuration.
44+
45+
- If you want to apply a configuration to `my-test-input.svelte`, add `my-test-config.json`.
46+
- If you want to apply the same configuration to all the fixtures in that directory, add `_config.json`.
47+
48+
To verify the output of invalid test cases requires `*-errors.json`, and `*-output.svelte` (for auto-fix). However, you don't have to add them yourself. If they do not exist, they will be automatically generated when you run the test. In other words, delete them manually when you want to recreate them.
49+
50+
**Tips**:
51+
52+
If you want to test only one rule, run the following command (for `indent` rule):
53+
54+
```sh
55+
yarn test -g indent
56+
```
57+
58+
Take <https://stackoverflow.com/questions/10832031/how-to-run-a-single-test-with-mocha> as reference for details.
59+
60+
If you want to test only `my-test-input.svelte`, add `my-test-config.json` and save `{"only": true}`.
61+
(Note that `{"only": true}` must be removed before making a pull request.)
62+
63+
## Commit messages
64+
65+
Please view [commitlint](https://commitlint.js.org) and [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) for more details.
66+
67+
## Publishing
68+
69+
We're using [changesets](https://github.com/changesets/changesets) for version management, CHANGELOG and releasing automatically.
70+
71+
Please view [changesets-bot](https://github.com/apps/changeset-bot) and its [action](https://github.com/changesets/action) for more details.

0 commit comments

Comments
 (0)