diff --git a/README.md b/README.md index d7ba245c5..a5661af1c 100644 --- a/README.md +++ b/README.md @@ -310,7 +310,7 @@ These rules relate to possible syntax or logic errors in Svelte code: | [svelte/no-dupe-style-properties](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-style-properties/) | disallow duplicate style properties | :star: | | [svelte/no-dupe-use-directives](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dupe-use-directives/) | disallow duplicate `use:` directives | | | [svelte/no-dynamic-slot-name](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-dynamic-slot-name/) | disallow dynamic slot name | :star::wrench: | -| [svelte/no-export-load-in-svelte-module-in-kit-pages](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-export-load-in-svelte-module-in-kit-pages/) | disallow exporting load functions in `*.svelte` module in Svelte Kit page components. | | +| [svelte/no-export-load-in-svelte-module-in-kit-pages](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-export-load-in-svelte-module-in-kit-pages/) | disallow exporting load functions in `*.svelte` module in SvelteKit page components. | | | [svelte/no-not-function-handler](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-not-function-handler/) | disallow use of not function in event handler | :star: | | [svelte/no-object-in-text-mustaches](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-object-in-text-mustaches/) | disallow objects in text mustache interpolation | :star: | | [svelte/no-reactive-reassign](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-reassign/) | disallow reassigning reactive values | | @@ -320,7 +320,7 @@ These rules relate to possible syntax or logic errors in Svelte code: | [svelte/require-store-callbacks-use-set-param](https://sveltejs.github.io/eslint-plugin-svelte/rules/require-store-callbacks-use-set-param/) | store callbacks must use `set` param | | | [svelte/require-store-reactive-access](https://sveltejs.github.io/eslint-plugin-svelte/rules/require-store-reactive-access/) | disallow to use of the store itself as an operand. Need to use $ prefix or get function. | :wrench: | | [svelte/valid-compile](https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-compile/) | disallow warnings when compiling. | :star: | -| [svelte/valid-prop-names-in-kit-pages](https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-prop-names-in-kit-pages/) | disallow props other than data or errors in Svelte Kit page components. | | +| [svelte/valid-prop-names-in-kit-pages](https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-prop-names-in-kit-pages/) | disallow props other than data or errors in SvelteKit page components. | | ## Security Vulnerability diff --git a/docs-svelte-kit/tools/generate-routes.mts b/docs-svelte-kit/tools/generate-routes.mts index b28891794..e0c7e2219 100644 --- a/docs-svelte-kit/tools/generate-routes.mts +++ b/docs-svelte-kit/tools/generate-routes.mts @@ -8,7 +8,7 @@ const dirname = path.dirname( ), ) -/** Generate svelte kit routes files */ +/** Generate SvelteKit routes files */ export default function generateRoutes(): void { const srcRoot = path.join(dirname, "../../docs") const distRoot = path.join(dirname, "../src/routes") diff --git a/docs/rules.md b/docs/rules.md index 276f34ff8..ef85cb467 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -23,7 +23,7 @@ These rules relate to possible syntax or logic errors in Svelte code: | [svelte/no-dupe-style-properties](./rules/no-dupe-style-properties.md) | disallow duplicate style properties | :star: | | [svelte/no-dupe-use-directives](./rules/no-dupe-use-directives.md) | disallow duplicate `use:` directives | | | [svelte/no-dynamic-slot-name](./rules/no-dynamic-slot-name.md) | disallow dynamic slot name | :star::wrench: | -| [svelte/no-export-load-in-svelte-module-in-kit-pages](./rules/no-export-load-in-svelte-module-in-kit-pages.md) | disallow exporting load functions in `*.svelte` module in Svelte Kit page components. | | +| [svelte/no-export-load-in-svelte-module-in-kit-pages](./rules/no-export-load-in-svelte-module-in-kit-pages.md) | disallow exporting load functions in `*.svelte` module in SvelteKit page components. | | | [svelte/no-not-function-handler](./rules/no-not-function-handler.md) | disallow use of not function in event handler | :star: | | [svelte/no-object-in-text-mustaches](./rules/no-object-in-text-mustaches.md) | disallow objects in text mustache interpolation | :star: | | [svelte/no-reactive-reassign](./rules/no-reactive-reassign.md) | disallow reassigning reactive values | | @@ -33,7 +33,7 @@ These rules relate to possible syntax or logic errors in Svelte code: | [svelte/require-store-callbacks-use-set-param](./rules/require-store-callbacks-use-set-param.md) | store callbacks must use `set` param | | | [svelte/require-store-reactive-access](./rules/require-store-reactive-access.md) | disallow to use of the store itself as an operand. Need to use $ prefix or get function. | :wrench: | | [svelte/valid-compile](./rules/valid-compile.md) | disallow warnings when compiling. | :star: | -| [svelte/valid-prop-names-in-kit-pages](./rules/valid-prop-names-in-kit-pages.md) | disallow props other than data or errors in Svelte Kit page components. | | +| [svelte/valid-prop-names-in-kit-pages](./rules/valid-prop-names-in-kit-pages.md) | disallow props other than data or errors in SvelteKit page components. | | ## Security Vulnerability diff --git a/docs/rules/no-export-load-in-svelte-module-in-kit-pages.md b/docs/rules/no-export-load-in-svelte-module-in-kit-pages.md index 4d2fa788d..3c3e8d695 100644 --- a/docs/rules/no-export-load-in-svelte-module-in-kit-pages.md +++ b/docs/rules/no-export-load-in-svelte-module-in-kit-pages.md @@ -2,13 +2,13 @@ pageClass: "rule-details" sidebarDepth: 0 title: "svelte/no-export-load-in-svelte-module-in-kit-pages" -description: "disallow exporting load functions in `*.svelte` module in Svelte Kit page components." +description: "disallow exporting load functions in `*.svelte` module in SvelteKit page components." since: "v2.12.0" --- # svelte/no-export-load-in-svelte-module-in-kit-pages -> disallow exporting load functions in `*.svelte` module in Svelte Kit page components. +> disallow exporting load functions in `*.svelte` module in SvelteKit page components. ## :book: Rule Details diff --git a/docs/rules/valid-prop-names-in-kit-pages.md b/docs/rules/valid-prop-names-in-kit-pages.md index 5218b0adf..a8e8fc336 100644 --- a/docs/rules/valid-prop-names-in-kit-pages.md +++ b/docs/rules/valid-prop-names-in-kit-pages.md @@ -2,13 +2,13 @@ pageClass: "rule-details" sidebarDepth: 0 title: "svelte/valid-prop-names-in-kit-pages" -description: "disallow props other than data or errors in Svelte Kit page components." +description: "disallow props other than data or errors in SvelteKit page components." since: "v2.12.0" --- # svelte/valid-prop-names-in-kit-pages -> disallow props other than data or errors in Svelte Kit page components. +> disallow props other than data or errors in SvelteKit page components. ## :book: Rule Details diff --git a/src/rules/no-export-load-in-svelte-module-in-kit-pages.ts b/src/rules/no-export-load-in-svelte-module-in-kit-pages.ts index 81c80ffab..fd3717d11 100644 --- a/src/rules/no-export-load-in-svelte-module-in-kit-pages.ts +++ b/src/rules/no-export-load-in-svelte-module-in-kit-pages.ts @@ -6,7 +6,7 @@ export default createRule("no-export-load-in-svelte-module-in-kit-pages", { meta: { docs: { description: - "disallow exporting load functions in `*.svelte` module in Svelte Kit page components.", + "disallow exporting load functions in `*.svelte` module in SvelteKit page components.", category: "Possible Errors", // TODO Switch to recommended in the major version. recommended: false, @@ -14,7 +14,7 @@ export default createRule("no-export-load-in-svelte-module-in-kit-pages", { schema: [], messages: { unexpected: - "disallow exporting load functions in `*.svelte` module in Svelte Kit page components.", + "disallow exporting load functions in `*.svelte` module in SvelteKit page components.", }, type: "problem", }, diff --git a/src/rules/valid-prop-names-in-kit-pages.ts b/src/rules/valid-prop-names-in-kit-pages.ts index c057383dc..cd0828168 100644 --- a/src/rules/valid-prop-names-in-kit-pages.ts +++ b/src/rules/valid-prop-names-in-kit-pages.ts @@ -9,7 +9,7 @@ export default createRule("valid-prop-names-in-kit-pages", { meta: { docs: { description: - "disallow props other than data or errors in Svelte Kit page components.", + "disallow props other than data or errors in SvelteKit page components.", category: "Possible Errors", // TODO Switch to recommended in the major version. recommended: false, @@ -17,7 +17,7 @@ export default createRule("valid-prop-names-in-kit-pages", { schema: [], messages: { unexpected: - "disallow props other than data or errors in Svelte Kit page components.", + "disallow props other than data or errors in SvelteKit page components.", }, type: "problem", }, diff --git a/src/utils/svelte-kit.ts b/src/utils/svelte-kit.ts index 2bb52050f..121d2b647 100644 --- a/src/utils/svelte-kit.ts +++ b/src/utils/svelte-kit.ts @@ -10,12 +10,12 @@ import { getPackageJson } from "./get-package-json" const isRunOnBrowser = !fs.readFileSync /** - * return true if it's a Svelte Kit page component. + * return true if it's a SvelteKit page component. * @param context * @returns */ export function isKitPageComponent(context: RuleContext): boolean { - // Hack: if it runs on browser, it regards as Svelte Kit project. + // Hack: if it runs on browser, it regards as SvelteKit project. if (isRunOnBrowser) return true if (!hasSvelteKit(context.getFilename())) return false const routes = @@ -40,7 +40,7 @@ export function isKitPageComponent(context: RuleContext): boolean { * @returns */ function hasSvelteKit(filePath: string): boolean { - // Hack: if it runs on browser, it regards as Svelte Kit project. + // Hack: if it runs on browser, it regards as SvelteKit project. if (isRunOnBrowser) return true try { const packageJson = getPackageJson(filePath) diff --git a/tests/fixtures/rules/no-export-load-in-svelte-module-in-kit-pages/invalid/+test01-errors.yaml b/tests/fixtures/rules/no-export-load-in-svelte-module-in-kit-pages/invalid/+test01-errors.yaml index 3dfa29f84..66f979651 100644 --- a/tests/fixtures/rules/no-export-load-in-svelte-module-in-kit-pages/invalid/+test01-errors.yaml +++ b/tests/fixtures/rules/no-export-load-in-svelte-module-in-kit-pages/invalid/+test01-errors.yaml @@ -1,4 +1,4 @@ -- message: "disallow exporting load functions in `*.svelte` module in Svelte Kit page components." +- message: "disallow exporting load functions in `*.svelte` module in SvelteKit page components." line: 2 column: 19 suggestions: null diff --git a/tests/fixtures/rules/no-export-load-in-svelte-module-in-kit-pages/invalid/+test02-errors.yaml b/tests/fixtures/rules/no-export-load-in-svelte-module-in-kit-pages/invalid/+test02-errors.yaml index 9917a6321..17bb184ce 100644 --- a/tests/fixtures/rules/no-export-load-in-svelte-module-in-kit-pages/invalid/+test02-errors.yaml +++ b/tests/fixtures/rules/no-export-load-in-svelte-module-in-kit-pages/invalid/+test02-errors.yaml @@ -1,4 +1,4 @@ -- message: "disallow exporting load functions in `*.svelte` module in Svelte Kit page components." +- message: "disallow exporting load functions in `*.svelte` module in SvelteKit page components." line: 2 column: 16 suggestions: null diff --git a/tests/fixtures/rules/valid-prop-names-in-kit-pages/invalid/+test001-errors.yaml b/tests/fixtures/rules/valid-prop-names-in-kit-pages/invalid/+test001-errors.yaml index e94d50d8a..1072269a7 100644 --- a/tests/fixtures/rules/valid-prop-names-in-kit-pages/invalid/+test001-errors.yaml +++ b/tests/fixtures/rules/valid-prop-names-in-kit-pages/invalid/+test001-errors.yaml @@ -1,24 +1,24 @@ -- message: disallow props other than data or errors in Svelte Kit page components. +- message: disallow props other than data or errors in SvelteKit page components. line: 2 column: 14 suggestions: null -- message: disallow props other than data or errors in Svelte Kit page components. +- message: disallow props other than data or errors in SvelteKit page components. line: 3 column: 14 suggestions: null -- message: disallow props other than data or errors in Svelte Kit page components. +- message: disallow props other than data or errors in SvelteKit page components. line: 4 column: 16 suggestions: null -- message: disallow props other than data or errors in Svelte Kit page components. +- message: disallow props other than data or errors in SvelteKit page components. line: 4 column: 21 suggestions: null -- message: disallow props other than data or errors in Svelte Kit page components. +- message: disallow props other than data or errors in SvelteKit page components. line: 5 column: 22 suggestions: null -- message: disallow props other than data or errors in Svelte Kit page components. +- message: disallow props other than data or errors in SvelteKit page components. line: 5 column: 37 suggestions: null