diff --git a/.changeset/angry-gorillas-help.md b/.changeset/angry-gorillas-help.md new file mode 100644 index 000000000..e0e2712c7 --- /dev/null +++ b/.changeset/angry-gorillas-help.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-svelte": patch +--- + +fix: disable no-self-assign rule (take2) diff --git a/.github/workflows/NodeCI.yml b/.github/workflows/NodeCI.yml index 1dfab976d..25cd1213d 100644 --- a/.github/workflows/NodeCI.yml +++ b/.github/workflows/NodeCI.yml @@ -53,6 +53,7 @@ jobs: run: |+ yarn add -D eslint@${{ matrix.eslint }} --ignore-engines rm -rf node_modules + rm -rf yarn.lock if: matrix.eslint != 8 - name: Install Packages run: yarn install --ignore-engines @@ -60,3 +61,18 @@ jobs: run: yarn test - name: Type Coverage run: yarn typecov + update-resources: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install Packages + run: yarn install --ignore-engines + - name: Update resources + run: yarn update + - name: Check changes + run: | + git add --all && \ + git diff-index --cached HEAD --stat --exit-code diff --git a/src/configs/base.ts b/src/configs/base.ts index 8719cea7c..450d6bca5 100644 --- a/src/configs/base.ts +++ b/src/configs/base.ts @@ -8,6 +8,8 @@ export = { // ESLint core rules known to cause problems with `.svelte`. "no-inner-declarations": "off", // The AST generated by svelte-eslint-parser will false positives in it rule because the root node of the script is not the `Program`. // "no-irregular-whitespace": "off", + // Self assign is one of way to update reactive value in Svelte. + "no-self-assign": "off", // eslint-plugin-svelte rules "svelte/comment-directive": "error", diff --git a/tools/update-rulesets.ts b/tools/update-rulesets.ts index b25db32bb..2a9dfed59 100644 --- a/tools/update-rulesets.ts +++ b/tools/update-rulesets.ts @@ -12,6 +12,8 @@ const baseContent = `export = { // ESLint core rules known to cause problems with \`.svelte\`. "no-inner-declarations": "off", // The AST generated by svelte-eslint-parser will false positives in it rule because the root node of the script is not the \`Program\`. // "no-irregular-whitespace": "off", + // Self assign is one of way to update reactive value in Svelte. + "no-self-assign": "off", // eslint-plugin-svelte rules ${rules