From df380e62f9c9c5c1983092f46de01ed91fd03543 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Sat, 27 Mar 2021 18:51:31 +0100 Subject: [PATCH] Add env to eslint config (#722) Else it will complain about uses of console.log etc. Added node/browser/es2017 for the 90% use case. Fixes https://github.com/sveltejs/language-tools/issues/918 --- .changeset/nasty-waves-kneel.md | 5 +++++ packages/create-svelte/template-additions/.eslintrc.cjs | 5 +++++ packages/create-svelte/template-additions/.eslintrc.ts.cjs | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 .changeset/nasty-waves-kneel.md diff --git a/.changeset/nasty-waves-kneel.md b/.changeset/nasty-waves-kneel.md new file mode 100644 index 000000000000..32a2771a3d91 --- /dev/null +++ b/.changeset/nasty-waves-kneel.md @@ -0,0 +1,5 @@ +--- +'create-svelte': patch +--- + +Add env options to eslint config diff --git a/packages/create-svelte/template-additions/.eslintrc.cjs b/packages/create-svelte/template-additions/.eslintrc.cjs index 3db3e4438566..b7a10ef8692f 100644 --- a/packages/create-svelte/template-additions/.eslintrc.cjs +++ b/packages/create-svelte/template-additions/.eslintrc.cjs @@ -6,5 +6,10 @@ module.exports = { parserOptions: { sourceType: 'module', ecmaVersion: 2018 + }, + env: { + browser: true, + es2017: true, + node: true } }; diff --git a/packages/create-svelte/template-additions/.eslintrc.ts.cjs b/packages/create-svelte/template-additions/.eslintrc.ts.cjs index 33f985c3237a..927ce7cac2a1 100644 --- a/packages/create-svelte/template-additions/.eslintrc.ts.cjs +++ b/packages/create-svelte/template-additions/.eslintrc.ts.cjs @@ -11,5 +11,10 @@ module.exports = { parserOptions: { sourceType: 'module', ecmaVersion: 2018 + }, + env: { + browser: true, + es2017: true, + node: true } };