diff --git a/.changeset/cuddly-cats-beam.md b/.changeset/cuddly-cats-beam.md new file mode 100644 index 000000000..dc0c41896 --- /dev/null +++ b/.changeset/cuddly-cats-beam.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-svelte": minor +--- + +feat: (experimental) partial support for Svelte v5 diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 000000000..ad4a76649 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,8 @@ +{ + "mode": "pre", + "tag": "next", + "initialVersions": { + "eslint-plugin-svelte": "2.35.0" + }, + "changesets": [] +} diff --git a/.eslintignore b/.eslintignore index b95b8f503..e895477e0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -16,6 +16,7 @@ /tests/fixtures/rules/valid-compile/valid/ts /tests/fixtures/rules/prefer-style-directive /tests/fixtures/rules/@typescript-eslint +/tests/fixtures/rules/valid-compile/valid/svelte3-options-custom-element-input.svelte /.svelte-kit /svelte.config-dist.js /build diff --git a/.github/workflows/NodeCI.yml b/.github/workflows/NodeCI.yml index c27cf13bc..377d64674 100644 --- a/.github/workflows/NodeCI.yml +++ b/.github/workflows/NodeCI.yml @@ -34,13 +34,13 @@ jobs: pnpm run update pnpm run build test: - name: 'Test for ESLint ${{ matrix.eslint }} on ${{ matrix.node }} OS: ${{matrix.os}}' + name: 'Test for ESLint ${{ matrix.eslint }} on Node.js: ${{ matrix.node }} OS: ${{matrix.os}}' runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] eslint: [7, 8] - node: [16, 17, 18, 20] + node: [20] steps: - name: Checkout uses: actions/checkout@v4 @@ -58,6 +58,29 @@ jobs: run: pnpm install - name: Test run: pnpm run test + test-for-svelte-v4: + name: 'Test for Svelte v4 on Node.js: ${{ matrix.node }} OS: ${{matrix.os}}' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node: [16, 17, 18, 20] + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + - name: Setup Node.js ${{ matrix.node }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Install svelte@4 + run: |+ + pnpm install -D svelte@4 + rm -rf node_modules + - name: Install Packages + run: pnpm install + - name: Test + run: pnpm run test test-for-svelte-v3: name: Test for Svelte v3 runs-on: ${{ matrix.os }} diff --git a/README.md b/README.md index 151fad7a0..51fdef1d2 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,17 @@ It provides many unique check rules using the AST generated by [svelte-eslint-pa ### ❗ Attention +#### Cannot be used with eslint-plugin-svelte3 + The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with the [eslint-plugin-svelte3]. [svelte-eslint-parser]: https://github.com/sveltejs/svelte-eslint-parser [eslint-plugin-svelte3]: https://github.com/sveltejs/eslint-plugin-svelte3 +#### Experimental support for Svelte v5 + +We are working on support for Svelte v5, but it is still an experimental feature. Please note that rules and features related to Svelte v5 may be changed or removed in minor versions without notice. + ## Migration Guide diff --git a/docs/README.md b/docs/README.md index b7aa3bfee..1df054ea3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,11 +29,17 @@ It provides many unique check rules using the AST generated by [svelte-eslint-pa ### ❗ Attention +#### Cannot be used with eslint-plugin-svelte3 + The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with the [eslint-plugin-svelte3]. [svelte-eslint-parser]: https://github.com/sveltejs/svelte-eslint-parser [eslint-plugin-svelte3]: https://github.com/sveltejs/eslint-plugin-svelte3 +#### Experimental support for Svelte v5 + +We are working on support for Svelte v5, but it is still an experimental feature. Please note that rules and features related to Svelte v5 may be changed or removed in minor versions without notice. + ## :book: Usage See [User Guide](./user-guide.md). diff --git a/package.json b/package.json index d41a309af..3698ba636 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0-0", - "svelte": "^3.37.0 || ^4.0.0" + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.8" }, "peerDependenciesMeta": { "svelte": { @@ -77,7 +77,7 @@ "postcss-safe-parser": "^6.0.0", "postcss-selector-parser": "^6.0.11", "semver": "^7.5.3", - "svelte-eslint-parser": ">=0.33.0 <1.0.0" + "svelte-eslint-parser": ">=0.34.0-next.2 <1.0.0" }, "devDependencies": { "@1stg/browserslist-config": "^1.2.3", @@ -164,7 +164,7 @@ "stylelint": "^15.0.0", "stylelint-config-standard": "^34.0.0", "stylus": "^0.62.0", - "svelte": "^4.0.0", + "svelte": "^5.0.0-next.8", "svelte-adapter-ghpages": "0.1.0", "svelte-i18n": "^4.0.0", "tslib": "^2.5.0", diff --git a/src/rules/indent-helpers/commons.ts b/src/rules/indent-helpers/commons.ts index ba21cf964..4ea95089a 100644 --- a/src/rules/indent-helpers/commons.ts +++ b/src/rules/indent-helpers/commons.ts @@ -90,6 +90,7 @@ export function isBeginningOfElement(node: AST.SvelteText): boolean { node.parent.type === 'SvelteElseBlock' || node.parent.type === 'SvelteIfBlock' || node.parent.type === 'SvelteKeyBlock' || + node.parent.type === 'SvelteSnippetBlock' || node.parent.type === 'SvelteStyleElement' ) { return node.parent.children[0] === node; diff --git a/src/rules/valid-compile.ts b/src/rules/valid-compile.ts index 0701d52ef..e56e6ec7b 100644 --- a/src/rules/valid-compile.ts +++ b/src/rules/valid-compile.ts @@ -28,7 +28,13 @@ export default createRule('valid-compile', { } const ignoreWarnings = Boolean(context.options[0]?.ignoreWarnings); - const ignores = ['missing-declaration', 'dynamic-slot-name']; + const ignores = [ + 'missing-declaration', + // Svelte v4 + 'dynamic-slot-name', + // Svelte v5 + 'invalid-slot-name' + ]; /** * report diff --git a/src/types-for-node.ts b/src/types-for-node.ts index 76cbfb109..ec2d5ff8a 100644 --- a/src/types-for-node.ts +++ b/src/types-for-node.ts @@ -221,6 +221,7 @@ export type ASTNodeListener = { SvelteMustacheTag?: (node: AST.SvelteMustacheTag & ASTNodeWithParent) => void; SvelteDebugTag?: (node: AST.SvelteDebugTag & ASTNodeWithParent) => void; SvelteConstTag?: (node: AST.SvelteConstTag & ASTNodeWithParent) => void; + SvelteRenderTag?: (node: AST.SvelteRenderTag & ASTNodeWithParent) => void; SvelteIfBlock?: (node: AST.SvelteIfBlock & ASTNodeWithParent) => void; SvelteElseBlock?: (node: AST.SvelteElseBlock & ASTNodeWithParent) => void; SvelteEachBlock?: (node: AST.SvelteEachBlock & ASTNodeWithParent) => void; @@ -229,6 +230,7 @@ export type ASTNodeListener = { SvelteAwaitThenBlock?: (node: AST.SvelteAwaitThenBlock & ASTNodeWithParent) => void; SvelteAwaitCatchBlock?: (node: AST.SvelteAwaitCatchBlock & ASTNodeWithParent) => void; SvelteKeyBlock?: (node: AST.SvelteKeyBlock & ASTNodeWithParent) => void; + SvelteSnippetBlock?: (node: AST.SvelteSnippetBlock & ASTNodeWithParent) => void; SvelteAttribute?: (node: AST.SvelteAttribute & ASTNodeWithParent) => void; SvelteShorthandAttribute?: (node: AST.SvelteShorthandAttribute & ASTNodeWithParent) => void; SvelteSpreadAttribute?: (node: AST.SvelteSpreadAttribute & ASTNodeWithParent) => void; @@ -439,6 +441,7 @@ export type SvelteNodeListener = { SvelteMustacheTag?: (node: AST.SvelteMustacheTag & ASTNodeWithParent) => void; SvelteDebugTag?: (node: AST.SvelteDebugTag & ASTNodeWithParent) => void; SvelteConstTag?: (node: AST.SvelteConstTag & ASTNodeWithParent) => void; + SvelteRenderTag?: (node: AST.SvelteRenderTag & ASTNodeWithParent) => void; SvelteIfBlock?: (node: AST.SvelteIfBlock & ASTNodeWithParent) => void; SvelteElseBlock?: (node: AST.SvelteElseBlock & ASTNodeWithParent) => void; SvelteEachBlock?: (node: AST.SvelteEachBlock & ASTNodeWithParent) => void; @@ -447,6 +450,7 @@ export type SvelteNodeListener = { SvelteAwaitThenBlock?: (node: AST.SvelteAwaitThenBlock & ASTNodeWithParent) => void; SvelteAwaitCatchBlock?: (node: AST.SvelteAwaitCatchBlock & ASTNodeWithParent) => void; SvelteKeyBlock?: (node: AST.SvelteKeyBlock & ASTNodeWithParent) => void; + SvelteSnippetBlock?: (node: AST.SvelteSnippetBlock & ASTNodeWithParent) => void; SvelteAttribute?: (node: AST.SvelteAttribute & ASTNodeWithParent) => void; SvelteShorthandAttribute?: (node: AST.SvelteShorthandAttribute & ASTNodeWithParent) => void; SvelteSpreadAttribute?: (node: AST.SvelteSpreadAttribute & ASTNodeWithParent) => void; diff --git a/tests/fixtures/rules/indent/invalid/await01-input.svelte b/tests/fixtures/rules/indent/invalid/await01-input.svelte index e974a395c..e6d74ecf5 100644 --- a/tests/fixtures/rules/indent/invalid/await01-input.svelte +++ b/tests/fixtures/rules/indent/invalid/await01-input.svelte @@ -83,3 +83,5 @@ name /await } + + diff --git a/tests/fixtures/rules/indent/invalid/await01-output.svelte b/tests/fixtures/rules/indent/invalid/await01-output.svelte index 99f0fa713..828ba7817 100644 --- a/tests/fixtures/rules/indent/invalid/await01-output.svelte +++ b/tests/fixtures/rules/indent/invalid/await01-output.svelte @@ -83,3 +83,5 @@ /await } + + diff --git a/tests/fixtures/rules/indent/invalid/await01-requirements.json b/tests/fixtures/rules/indent/invalid/await01-requirements.json new file mode 100644 index 000000000..3217ed4a2 --- /dev/null +++ b/tests/fixtures/rules/indent/invalid/await01-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems to return the wrong location in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/indent/invalid/each01-requirements.json b/tests/fixtures/rules/indent/invalid/each01-requirements.json new file mode 100644 index 000000000..3217ed4a2 --- /dev/null +++ b/tests/fixtures/rules/indent/invalid/each01-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems to return the wrong location in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/indent/invalid/if01-requirements.json b/tests/fixtures/rules/indent/invalid/if01-requirements.json new file mode 100644 index 000000000..3217ed4a2 --- /dev/null +++ b/tests/fixtures/rules/indent/invalid/if01-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems to return the wrong location in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/indent/invalid/key01-requirements.json b/tests/fixtures/rules/indent/invalid/key01-requirements.json new file mode 100644 index 000000000..3217ed4a2 --- /dev/null +++ b/tests/fixtures/rules/indent/invalid/key01-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems to return the wrong location in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/mustache-spacing/invalid/always/test01-input.svelte b/tests/fixtures/rules/mustache-spacing/invalid/always/test01-input.svelte index dec41e0b9..a47613804 100644 --- a/tests/fixtures/rules/mustache-spacing/invalid/always/test01-input.svelte +++ b/tests/fixtures/rules/mustache-spacing/invalid/always/test01-input.svelte @@ -46,3 +46,5 @@ {#await expression}...{:then}...{:catch}...{/await} {#key expression}...{/key} + + diff --git a/tests/fixtures/rules/mustache-spacing/invalid/always/test01-output.svelte b/tests/fixtures/rules/mustache-spacing/invalid/always/test01-output.svelte index 8eec437c1..113d6aefd 100644 --- a/tests/fixtures/rules/mustache-spacing/invalid/always/test01-output.svelte +++ b/tests/fixtures/rules/mustache-spacing/invalid/always/test01-output.svelte @@ -46,3 +46,5 @@ { #await expression }...{ :then}...{ :catch}...{ /await } { #key expression }...{ /key } + + diff --git a/tests/fixtures/rules/mustache-spacing/invalid/test01-input.svelte b/tests/fixtures/rules/mustache-spacing/invalid/test01-input.svelte index e6d19dcd4..10ec4b852 100644 --- a/tests/fixtures/rules/mustache-spacing/invalid/test01-input.svelte +++ b/tests/fixtures/rules/mustache-spacing/invalid/test01-input.svelte @@ -46,3 +46,5 @@ { #key expression }...{ /key } + + diff --git a/tests/fixtures/rules/mustache-spacing/invalid/test01-output.svelte b/tests/fixtures/rules/mustache-spacing/invalid/test01-output.svelte index aefac172f..23515c7fb 100644 --- a/tests/fixtures/rules/mustache-spacing/invalid/test01-output.svelte +++ b/tests/fixtures/rules/mustache-spacing/invalid/test01-output.svelte @@ -46,3 +46,5 @@ {#key expression}...{/key} + + diff --git a/tests/fixtures/rules/mustache-spacing/invalid/test01-requirements.json b/tests/fixtures/rules/mustache-spacing/invalid/test01-requirements.json new file mode 100644 index 000000000..3217ed4a2 --- /dev/null +++ b/tests/fixtures/rules/mustache-spacing/invalid/test01-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems to return the wrong location in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-errors.yaml b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-errors.yaml index f0d33cb16..828b7a9b8 100644 --- a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-errors.yaml +++ b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-errors.yaml @@ -1,8 +1,4 @@ - message: svelte-ignore comment is used, but not warned - line: 3 - column: 19 - suggestions: null -- message: svelte-ignore comment is used, but not warned - line: 5 + line: 4 column: 19 suggestions: null diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-input.svelte b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-input.svelte index 9cb4e088f..af67bb87e 100644 --- a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-input.svelte +++ b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-input.svelte @@ -1,9 +1,11 @@ -{used} +{mutable}{immutable} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-requirements.json new file mode 100644 index 000000000..0192b1098 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-requirements.json @@ -0,0 +1,3 @@ +{ + "svelte": ">=5.0.0-0" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-errors.yaml b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-errors.yaml new file mode 100644 index 000000000..f0d33cb16 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-errors.yaml @@ -0,0 +1,8 @@ +- message: svelte-ignore comment is used, but not warned + line: 3 + column: 19 + suggestions: null +- message: svelte-ignore comment is used, but not warned + line: 5 + column: 19 + suggestions: null diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-input.svelte b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-input.svelte new file mode 100644 index 000000000..9cb4e088f --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-input.svelte @@ -0,0 +1,9 @@ + + +{used} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-requirements.json new file mode 100644 index 000000000..b650cc296 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment01-svelte4-requirements.json @@ -0,0 +1,3 @@ +{ + "svelte": "^3.0.0 || ^4.0.0" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-errors.yaml b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-svelte4-errors.yaml similarity index 100% rename from tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-errors.yaml rename to tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-svelte4-errors.yaml diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-input.svelte b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-svelte4-input.svelte similarity index 100% rename from tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-input.svelte rename to tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-svelte4-input.svelte diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-svelte4-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-svelte4-requirements.json new file mode 100644 index 000000000..b650cc296 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/invalid/script-comment02-svelte4-requirements.json @@ -0,0 +1,3 @@ +{ + "svelte": "^3.0.0 || ^4.0.0" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/has-error-input.svelte b/tests/fixtures/rules/no-unused-svelte-ignore/valid/has-error-svelte4-input.svelte similarity index 100% rename from tests/fixtures/rules/no-unused-svelte-ignore/valid/has-error-input.svelte rename to tests/fixtures/rules/no-unused-svelte-ignore/valid/has-error-svelte4-input.svelte diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/has-error-svelte4-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/has-error-svelte4-requirements.json new file mode 100644 index 000000000..b650cc296 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/has-error-svelte4-requirements.json @@ -0,0 +1,3 @@ +{ + "svelte": "^3.0.0 || ^4.0.0" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-input.svelte b/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-input.svelte index 4a8e38e57..951dd9d97 100644 --- a/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-input.svelte +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-input.svelte @@ -1,10 +1,6 @@ - - + +{immutable} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-requirements.json new file mode 100644 index 000000000..0192b1098 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-requirements.json @@ -0,0 +1,3 @@ +{ + "svelte": ">=5.0.0-0" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-svelte4-input.svelte b/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-svelte4-input.svelte new file mode 100644 index 000000000..4a8e38e57 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-svelte4-input.svelte @@ -0,0 +1,10 @@ + + + diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-svelte4-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-svelte4-requirements.json new file mode 100644 index 000000000..b650cc296 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/script-comment-svelte4-requirements.json @@ -0,0 +1,3 @@ +{ + "svelte": "^3.0.0 || ^4.0.0" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang01-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang01-requirements.json new file mode 100644 index 000000000..e18fe1560 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang01-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang02-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang02-requirements.json new file mode 100644 index 000000000..e18fe1560 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang02-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang03-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang03-requirements.json new file mode 100644 index 000000000..e18fe1560 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang03-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang04-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang04-requirements.json new file mode 100644 index 000000000..e18fe1560 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang04-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang05-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang05-requirements.json new file mode 100644 index 000000000..e18fe1560 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang05-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang06-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang06-requirements.json new file mode 100644 index 000000000..e18fe1560 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/style-lang06-requirements.json @@ -0,0 +1,4 @@ +{ + "FIXME": "It seems that unused selectors are not checked yet in Svelte v5.", + "svelte": "^4 || ^3" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-input.svelte b/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-input.svelte index 059de337a..a0eca9930 100644 --- a/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-input.svelte +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-input.svelte @@ -1,4 +1,10 @@ - + +{mutable}{immutable} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-requirements.json new file mode 100644 index 000000000..0192b1098 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-requirements.json @@ -0,0 +1,3 @@ +{ + "svelte": ">=5.0.0-0" +} diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-svelte4-input.svelte b/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-svelte4-input.svelte new file mode 100644 index 000000000..059de337a --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-svelte4-input.svelte @@ -0,0 +1,4 @@ + diff --git a/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-svelte4-requirements.json b/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-svelte4-requirements.json new file mode 100644 index 000000000..b650cc296 --- /dev/null +++ b/tests/fixtures/rules/no-unused-svelte-ignore/valid/ts-lang01-svelte4-requirements.json @@ -0,0 +1,3 @@ +{ + "svelte": "^3.0.0 || ^4.0.0" +} diff --git a/tests/fixtures/rules/valid-compile/invalid/invalid-svelte-ignore03-errors.yaml b/tests/fixtures/rules/valid-compile/invalid/invalid-svelte-ignore03-errors.yaml index 207168f1b..108d833cd 100644 --- a/tests/fixtures/rules/valid-compile/invalid/invalid-svelte-ignore03-errors.yaml +++ b/tests/fixtures/rules/valid-compile/invalid/invalid-svelte-ignore03-errors.yaml @@ -1,7 +1,3 @@ -- message: Empty block(empty-block) - line: 2 - column: 30 - suggestions: null - message: 'A11y: noninteractive element cannot have nonnegative tabIndex value(a11y-no-noninteractive-tabindex)' line: 5 @@ -32,10 +28,6 @@ line: 10 column: 3 suggestions: null -- message: Empty block(empty-block) - line: 14 - column: 30 - suggestions: null - message: 'A11y: noninteractive element cannot have nonnegative tabIndex value(a11y-no-noninteractive-tabindex)' line: 17 diff --git a/tests/fixtures/rules/valid-compile/invalid/invalid-svelte-ignore03-input.svelte b/tests/fixtures/rules/valid-compile/invalid/invalid-svelte-ignore03-input.svelte index c1c204b26..53c3950db 100644 --- a/tests/fixtures/rules/valid-compile/invalid/invalid-svelte-ignore03-input.svelte +++ b/tests/fixtures/rules/valid-compile/invalid/invalid-svelte-ignore03-input.svelte @@ -18,3 +18,5 @@