Skip to content

Commit ab5b55e

Browse files
committed
Merge branch 'main' into postcss-style-parsing
2 parents acd0d56 + 177c83d commit ab5b55e

File tree

103 files changed

+87500
-405
lines changed

Some content is hidden

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

103 files changed

+87500
-405
lines changed

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// "forwardPorts": [],
2424

2525
// Use 'postCreateCommand' to run commands after the container is created.
26-
"postCreateCommand": "yarn install",
26+
"postCreateCommand": "pnpm install",
2727

2828
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
2929
"remoteUser": "node"

.env-cmdrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"version-ci": {
3+
"IN_VERSION_CI_SCRIPT": "true"
4+
}
5+
}

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module.exports = {
6969
"@typescript-eslint/no-use-before-define": "off",
7070
"@typescript-eslint/no-explicit-any": "off",
7171
"no-implicit-globals": "off",
72+
"no-void": ["error", { allowAsStatement: true }],
7273
},
7374
},
7475
{

.github/workflows/GHPages.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v3
28+
- uses: pnpm/action-setup@v2
2829
- uses: actions/setup-node@v3
2930
- name: Install And Build
3031
run: |+
31-
yarn install
32-
yarn build
32+
pnpm install
33+
pnpm run build
3334
cd explorer-v2
34-
yarn install
35-
yarn pre-build
36-
yarn build
35+
pnpm install
36+
pnpm run pre-build
37+
pnpm run build
3738
- name: Setup Pages
3839
uses: actions/configure-pages@v3
3940
- name: Upload artifact

.github/workflows/NodeCI.yml

+23-17
Original file line numberDiff line numberDiff line change
@@ -11,77 +11,82 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v3
14+
- uses: pnpm/action-setup@v2
1415
- uses: actions/setup-node@v3
1516
- name: Install Packages
16-
run: yarn install
17+
run: pnpm install
1718
- name: Lint
18-
run: yarn lint
19+
run: pnpm run lint
1920
- name: Build
20-
run: yarn build
21+
run: pnpm run build
2122
test:
2223
runs-on: ubuntu-latest
2324
strategy:
2425
matrix:
25-
node-version: [12.x, 14.x, 16.x, 17.x, 18.x, 19.x]
26+
node-version: [14.x, 16.x, 17.x, 18.x, 19.x]
2627
steps:
2728
- uses: actions/checkout@v3
29+
- uses: pnpm/action-setup@v2
2830
- name: Use Node.js ${{ matrix.node-version }}
2931
uses: actions/setup-node@v3
3032
with:
3133
node-version: ${{ matrix.node-version }}
3234
- name: Install Packages
33-
run: yarn install --ignore-engines
35+
run: pnpm install
3436
- name: Test
35-
run: yarn test
37+
run: pnpm run test
3638
test-for-ts-eslint-v4:
3739
runs-on: ubuntu-latest
3840
strategy:
3941
matrix:
4042
node-version: [14.x]
4143
steps:
4244
- uses: actions/checkout@v3
45+
- uses: pnpm/action-setup@v2
4346
- name: Use Node.js ${{ matrix.node-version }}
4447
uses: actions/setup-node@v3
4548
with:
4649
node-version: ${{ matrix.node-version }}
4750
- name: Install @typescript-eslint v4
4851
run: |+
49-
yarn add -D @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4 eslint@7 --ignore-engines
52+
pnpm install -D @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4 eslint@7
5053
rm -rf node_modules
5154
- name: Install Packages
52-
run: yarn install --ignore-engines
55+
run: pnpm install
5356
- name: Test
54-
run: yarn test
57+
run: pnpm run test
5558
test-for-eslint-v7:
5659
runs-on: ubuntu-latest
5760
strategy:
5861
matrix:
5962
node-version: [14.x]
6063
steps:
6164
- uses: actions/checkout@v3
65+
- uses: pnpm/action-setup@v2
6266
- name: Use Node.js ${{ matrix.node-version }}
6367
uses: actions/setup-node@v3
6468
with:
6569
node-version: ${{ matrix.node-version }}
6670
- name: Install eslint v7
6771
run: |+
68-
yarn add -D eslint@7 --ignore-engines
72+
pnpm install -D eslint@7
6973
rm -rf node_modules
7074
- name: Install Packages
71-
run: yarn install --ignore-engines
75+
run: pnpm install
7276
- name: Test
73-
run: yarn test
77+
run: pnpm run test
7478
update-fixtures:
7579
runs-on: ubuntu-latest
7680
steps:
7781
- uses: actions/checkout@v3
82+
- uses: pnpm/action-setup@v2
7883
- uses: actions/setup-node@v3
7984
with:
8085
node-version: 18
8186
- name: Install Packages
82-
run: yarn install --ignore-engines
87+
run: pnpm install
8388
- name: Update fixtures
84-
run: yarn update-fixtures
89+
run: pnpm run update-fixtures
8590
- name: Check changes
8691
run: |
8792
git add --all && \
@@ -90,12 +95,13 @@ jobs:
9095
runs-on: ubuntu-latest
9196
steps:
9297
- uses: actions/checkout@v3
98+
- uses: pnpm/action-setup@v2
9399
- uses: actions/setup-node@v3
94100
- name: Install Packages
95-
run: yarn install --ignore-engines
101+
run: pnpm install
96102
- name: Test
97-
run: yarn cover
103+
run: pnpm run cover
98104
- name: Coveralls GitHub Action
99-
uses: coverallsapp/github-action@v2.0.0
105+
uses: coverallsapp/github-action@v2.1.2
100106
with:
101107
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/Release.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,25 @@ jobs:
2121
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2222
fetch-depth: 0
2323

24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v2
26+
2427
- name: Setup Node.js 16
2528
uses: actions/setup-node@v3
2629
with:
2730
node-version: 16
2831

2932
- name: Install Dependencies
30-
run: yarn
33+
run: pnpm install
3134

3235
- name: Create Release Pull Request or Publish to npm
3336
id: changesets
3437
uses: changesets/action@v1
3538
with:
39+
# this expects you to have a npm script called version that runs some logic and then calls `changeset version`.
40+
version: pnpm run version:ci
3641
# This expects you to have a script called release which does a build for your packages and calls changeset publish
37-
publish: yarn release
42+
publish: pnpm run release
3843
commit: "chore: release svelte-eslint-parser"
3944
title: "chore: release svelte-eslint-parser"
4045
env:

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ dist
104104
.tern-port
105105

106106
# repo
107-
yarn.lock
107+
/pnpm-lock.yaml
108108
/lib
109109
/.nyc_output
110110
/coverage

.npmrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
package-lock=false
1+
package-lock=false
2+
enable-pre-post-scripts=true

CHANGELOG.md

+34
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# svelte-eslint-parser
22

3+
## 0.29.0
4+
5+
### 💥 Breaking Changes
6+
7+
- [#334](https://github.com/sveltejs/svelte-eslint-parser/pull/334) [`fa4adf6`](https://github.com/sveltejs/svelte-eslint-parser/commit/fa4adf6038810573df6cdead34800fb41b3ab3d5) Thanks [@baseballyama](https://github.com/baseballyama)! - **BREAKING CHANGE**: Drop Node 12 support
8+
9+
### Minor Changes
10+
11+
- [#338](https://github.com/sveltejs/svelte-eslint-parser/pull/338) [`af55230`](https://github.com/sveltejs/svelte-eslint-parser/commit/af5523076d72e29d9f7cc2708d514564a2fafb45) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: improve `$$` vars type
12+
13+
### Patch Changes
14+
15+
- [#337](https://github.com/sveltejs/svelte-eslint-parser/pull/337) [`21c0dc6`](https://github.com/sveltejs/svelte-eslint-parser/commit/21c0dc6a0b4a5e864e0181dfbb31f4b47edcefd1) Thanks [@ota-meshi](https://github.com/ota-meshi)! - fix: wrong scope for ts in `bind:`
16+
17+
## 0.28.0
18+
19+
### Minor Changes
20+
21+
- [#329](https://github.com/sveltejs/svelte-eslint-parser/pull/329) [`45c958e`](https://github.com/sveltejs/svelte-eslint-parser/commit/45c958e752ed2ea1b7d8df3fe21ffc0f7a664275) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: export meta object
22+
23+
## 0.27.0
24+
25+
### Minor Changes
26+
27+
- [#314](https://github.com/sveltejs/svelte-eslint-parser/pull/314) [`96a72a5`](https://github.com/sveltejs/svelte-eslint-parser/commit/96a72a5d9e549c6f433a104b5db296684015303c) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: improve component event handler type
28+
29+
- [#325](https://github.com/sveltejs/svelte-eslint-parser/pull/325) [`36b01ec`](https://github.com/sveltejs/svelte-eslint-parser/commit/36b01ecb3abf6b793127e577d0aa213f9fea32a3) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: support for `use:` directive parameter type
30+
31+
## 0.26.1
32+
33+
### Patch Changes
34+
35+
- [#316](https://github.com/sveltejs/svelte-eslint-parser/pull/316) [`501c1b4`](https://github.com/sveltejs/svelte-eslint-parser/commit/501c1b474c14ab3d1655391bacc16c300493cf1c) Thanks [@ota-meshi](https://github.com/ota-meshi)! - fix: crash with plain `this` attribute.
36+
337
## 0.26.0
438

539
### Minor Changes

README.md

+2-17
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,15 @@ You can check it on [Online DEMO](https://sveltejs.github.io/svelte-eslint-parse
1313
[![Build Status](https://github.com/sveltejs/svelte-eslint-parser/workflows/CI/badge.svg?branch=main)](https://github.com/sveltejs/svelte-eslint-parser/actions?query=workflow%3ACI)
1414
[![Coverage Status](https://coveralls.io/repos/github/sveltejs/svelte-eslint-parser/badge.svg?branch=main)](https://coveralls.io/github/sveltejs/svelte-eslint-parser?branch=main)
1515

16-
## ❓ Why?
16+
## ⤴️ Motivation
1717

18-
[Svelte] has the official ESLint plugin the [eslint-plugin-svelte3]. The [eslint-plugin-svelte3] works well enough to check scripts. However, it does not handle the AST of the template, which makes it very difficult for third parties to create their own the [ESLint] rules for the [Svelte].
19-
20-
The [svelte-eslint-parser] aims to make it easy to create your own rules for the [Svelte] by allowing the template AST to be used in the rules.
18+
The [svelte-eslint-parser] aims to make it easy to create your own ESLint rules for [Svelte].
2119

2220
The [`eslint-plugin-svelte`] is an ESLint plugin that uses the [svelte-eslint-parser]. I have already [implemented some rules].
2321

2422
[`eslint-plugin-svelte`]: https://github.com/sveltejs/eslint-plugin-svelte
2523
[implemented some rules]: https://sveltejs.github.io/eslint-plugin-svelte/rules/
2624

27-
### Benefits of Using AST
28-
29-
- We can create rules using the information contained in the AST.
30-
e.g.
31-
- [svelte/no-dupe-else-if-blocks](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-else-if-blocks/) rule
32-
- [svelte/no-at-html-tags](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-at-html-tags/) rule
33-
- [svelte/no-at-debug-tags](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-at-debug-tags/) rule
34-
- Rules that use text work well.
35-
e.g.
36-
- [eol-last](https://eslint.org/docs/rules/eol-last) rule
37-
- [unicode-bom](https://eslint.org/docs/rules/unicode-bom) rule
38-
- [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
39-
4025
### ESLint Plugins Using svelte-eslint-parser
4126

4227
#### [eslint-plugin-svelte](https://sveltejs.github.io/eslint-plugin-svelte/)

explorer-v2/.prettierrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"useTabs": true,
33
"singleQuote": true,
44
"trailingComma": "none",
5-
"printWidth": 100
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"]
67
}

explorer-v2/build-system/pre-build/webpack.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const output = {
66
filename: '[name].js',
77
library: {
88
type: 'module'
9-
}
9+
},
10+
hashFunction: 'xxhash64'
1011
};
1112
const alias = {
1213
assert: resolve('./shim-assert.cjs'),

explorer-v2/package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@
1717
"eslint": "^8.0.0",
1818
"eslint-plugin-svelte3": "^4.0.0",
1919
"eslint-scope": "^7.0.0",
20+
"esquery": "^1.5.0",
2021
"pako": "^2.0.3",
2122
"svelte": "^3.41.0",
22-
"svelte-eslint-parser": "link:.."
23+
"svelte-eslint-parser": "link:..",
24+
"tslib": "^2.5.0"
2325
},
2426
"devDependencies": {
2527
"@sveltejs/adapter-static": "^2.0.0",
2628
"@sveltejs/kit": "^1.0.0-next.456",
2729
"prettier": "^2.3.0",
2830
"prettier-plugin-svelte": "^2.3.0",
2931
"string-replace-loader": "^3.0.1",
32+
"typescript": "^5.0.4",
3033
"vite": "^4.0.0",
31-
"webpack": "^5.37.1",
34+
"webpack": "^5.82.1",
3235
"webpack-cli": "^5.0.0",
3336
"wrapper-webpack-plugin": "^2.1.0"
3437
}

explorer-v2/src/app.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77

88
%sveltekit.head%
9-
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.36.1/min/vs/loader.min.js"></script>
9+
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.38.0/min/vs/loader.min.js"></script>
1010
</head>
1111
<body>
1212
<div id="svelte">%sveltekit.body%</div>

0 commit comments

Comments
 (0)