From 025eed1a297fbdd4ffe5dfa52f8d0cc959a7fc08 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sat, 6 Jul 2019 18:28:58 -0400 Subject: [PATCH] fix ESLint and eslint-plugin-svelte3 stuff --- .eslintrc.js | 99 ++++++++++++++++++++++++++++++++++++++++++ .eslintrc.json | 80 ---------------------------------- package-lock.json | 6 +++ package.json | 1 + site/.eslintrc.js | 52 ++++++++++++++++++++++ site/.eslintrc.json | 51 ---------------------- site/package-lock.json | 6 --- site/package.json | 1 - 8 files changed, 158 insertions(+), 138 deletions(-) create mode 100644 .eslintrc.js delete mode 100644 .eslintrc.json create mode 100644 site/.eslintrc.js delete mode 100644 site/.eslintrc.json diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..2c7f2ed1b4 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,99 @@ +module.exports = { + root: true, + rules: { + indent: 'off', + 'no-unused-vars': 'off', + semi: [2, 'always'], + 'keyword-spacing': [2, { before: true, after: true }], + 'space-before-blocks': [2, 'always'], + 'no-mixed-spaces-and-tabs': [2, 'smart-tabs'], + 'no-cond-assign': 0, + 'object-shorthand': [2, 'always'], + 'no-const-assign': 2, + 'no-class-assign': 2, + 'no-this-before-super': 2, + 'no-var': 2, + 'no-unreachable': 2, + 'valid-typeof': 2, + 'quote-props': [2, 'as-needed'], + 'one-var': [2, 'never'], + 'prefer-arrow-callback': 2, + 'prefer-const': [2, { destructuring: 'all' }], + 'arrow-spacing': 2, + 'no-inner-declarations': 0, + 'require-atomic-updates': 'off', + '@typescript-eslint/indent': [ + 'error', + 'tab', + { + SwitchCase: 1, + ignoredNodes: ['TemplateLiteral'] + } + ], + '@typescript-eslint/camelcase': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/array-type': ['error', 'array-simple'], + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/explicit-member-accessibility': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_' + } + ], + '@typescript-eslint/no-object-literal-type-assertion': [ + 'error', + { + allowAsParameter: true + } + ], + '@typescript-eslint/no-unused-vars': 'off' + }, + globals: { + globalThis: false + }, + env: { + es6: true, + browser: true, + node: true, + mocha: true + }, + extends: [ + 'eslint:recommended', + 'plugin:import/errors', + 'plugin:import/warnings', + 'plugin:import/typescript', + 'plugin:@typescript-eslint/recommended' + ], + parserOptions: { + ecmaVersion: 9, + sourceType: 'module' + }, + plugins: ['svelte3'], + settings: { + 'import/core-modules': [ + 'svelte', + 'svelte/internal', + 'svelte/store', + 'svelte/easing', + 'estree' + ], + 'svelte3/compiler': require('./compiler') + }, + overrides: [ + { + files: ['*.js'], + rules: { + '@typescript-eslint/no-var-requires': 'off' + } + }, + { + files: ['*.svelte'], + processor: 'svelte3/svelte3', + rules: { + '@typescript-eslint/indent': 'off' + } + } + ] +}; diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 722b0e9067..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "root": true, - "rules": { - "indent": "off", - "no-unused-vars": "off", - "semi": [2, "always"], - "keyword-spacing": [2, { "before": true, "after": true }], - "space-before-blocks": [2, "always"], - "no-mixed-spaces-and-tabs": [2, "smart-tabs"], - "no-cond-assign": 0, - "object-shorthand": [2, "always"], - "no-const-assign": 2, - "no-class-assign": 2, - "no-this-before-super": 2, - "no-var": 2, - "no-unreachable": 2, - "valid-typeof": 2, - "quote-props": [2, "as-needed"], - "one-var": [2, "never"], - "prefer-arrow-callback": 2, - "prefer-const": [2, { "destructuring": "all" }], - "arrow-spacing": 2, - "no-inner-declarations": 0, - "require-atomic-updates": "off", - "@typescript-eslint/indent": ["error", "tab", { - "SwitchCase": 1, - "ignoredNodes": ["TemplateLiteral"] - }], - "@typescript-eslint/camelcase": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/array-type": ["error", "array-simple"], - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/explicit-member-accessibility": "off", - "@typescript-eslint/no-unused-vars": ["error", { - "argsIgnorePattern": "^_" - }], - "@typescript-eslint/no-object-literal-type-assertion": ["error", { - "allowAsParameter": true - }], - "@typescript-eslint/no-unused-vars": "off" - }, - "globals": { - "globalThis": false - }, - "env": { - "es6": true, - "browser": true, - "node": true, - "mocha": true - }, - "extends": [ - "eslint:recommended", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:import/typescript", - "plugin:@typescript-eslint/recommended" - ], - "parserOptions": { - "ecmaVersion": 9, - "sourceType": "module" - }, - "settings": { - "import/core-modules": [ - "svelte", - "svelte/internal", - "svelte/store", - "svelte/easing", - "estree" - ] - }, - "overrides": [ - { - "files": ["*.js"], - "rules": { - "@typescript-eslint/no-var-requires": "off" - } - } - ] -} diff --git a/package-lock.json b/package-lock.json index d88b9920fb..f60de877cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1206,6 +1206,12 @@ } } }, + "eslint-plugin-svelte3": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-svelte3/-/eslint-plugin-svelte3-2.6.0.tgz", + "integrity": "sha512-HtoVRGo/Bjkv/S+OyPZFL/O8kwLAQpWvW4QJMP9BKDyBkrAPMlEdXCLPMFAOH4cEJmkdfgJIWuTNwOPX8W571A==", + "dev": true + }, "eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", diff --git a/package.json b/package.json index faa1c26952..34ca5a9f7e 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "css-tree": "1.0.0-alpha22", "eslint": "^6.0.1", "eslint-plugin-import": "^2.18.0", + "eslint-plugin-svelte3": "^2.6.0", "estree-walker": "^0.6.1", "is-reference": "^1.1.1", "jsdom": "^12.2.0", diff --git a/site/.eslintrc.js b/site/.eslintrc.js new file mode 100644 index 0000000000..a436f7bbe4 --- /dev/null +++ b/site/.eslintrc.js @@ -0,0 +1,52 @@ +module.exports = { + root: true, + rules: { + indent: [2, 'tab', { SwitchCase: 1 }], + semi: [2, 'always'], + 'keyword-spacing': [2, { before: true, after: true }], + 'space-before-blocks': [2, 'always'], + 'no-mixed-spaces-and-tabs': [2, 'smart-tabs'], + 'no-cond-assign': 0, + 'no-unused-vars': 2, + 'object-shorthand': [2, 'always'], + 'no-const-assign': 2, + 'no-class-assign': 2, + 'no-this-before-super': 2, + 'no-var': 2, + 'no-unreachable': 2, + 'valid-typeof': 2, + 'quote-props': [2, 'as-needed'], + 'one-var': [2, 'never'], + 'prefer-arrow-callback': 2, + 'prefer-const': [2, { destructuring: 'all' }], + 'arrow-spacing': 2, + 'no-inner-declarations': 0, + 'require-atomic-updates': 0 + }, + env: { + es6: true, + browser: true, + node: true, + mocha: true + }, + extends: [ + 'eslint:recommended', + 'plugin:import/errors', + 'plugin:import/warnings' + ], + plugins: ['svelte3'], + overrides: [ + { + files: ['*.svelte'], + processor: 'svelte3/svelte3' + } + ], + parserOptions: { + ecmaVersion: 9, + sourceType: 'module' + }, + settings: { + 'import/core-modules': ['svelte'], + 'svelte3/compiler': require('svelte/compiler') + } +}; diff --git a/site/.eslintrc.json b/site/.eslintrc.json deleted file mode 100644 index 78216cb5e0..0000000000 --- a/site/.eslintrc.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "root": true, - "rules": { - "indent": [2, "tab", { "SwitchCase": 1 }], - "semi": [2, "always"], - "keyword-spacing": [2, { "before": true, "after": true }], - "space-before-blocks": [2, "always"], - "no-mixed-spaces-and-tabs": [2, "smart-tabs"], - "no-cond-assign": 0, - "no-unused-vars": 2, - "object-shorthand": [2, "always"], - "no-const-assign": 2, - "no-class-assign": 2, - "no-this-before-super": 2, - "no-var": 2, - "no-unreachable": 2, - "valid-typeof": 2, - "quote-props": [2, "as-needed"], - "one-var": [2, "never"], - "prefer-arrow-callback": 2, - "prefer-const": [2, { "destructuring": "all" }], - "arrow-spacing": 2, - "no-inner-declarations": 0, - "require-atomic-updates": 0 - }, - "env": { - "es6": true, - "browser": true, - "node": true, - "mocha": true - }, - "extends": [ - "eslint:recommended", - "plugin:import/errors", - "plugin:import/warnings" - ], - "plugins": ["svelte3"], - "overrides": [ - { - "files": "*.svelte", - "processor": "svelte3/svelte3" - } - ], - "parserOptions": { - "ecmaVersion": 9, - "sourceType": "module" - }, - "settings": { - "import/core-modules": ["svelte"] - } -} diff --git a/site/package-lock.json b/site/package-lock.json index b44cd757ef..9852fb9aa0 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -2124,12 +2124,6 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "eslint-plugin-svelte3": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-svelte3/-/eslint-plugin-svelte3-2.5.0.tgz", - "integrity": "sha512-oFRl4fbI/b1+Wp0igAssyTSkGwTv3iVaZVFSQl+k+4J9vKQ1T0niAM35EMfZ/nm9747Um3Vr032RMtqw3M8GmA==", - "dev": true - }, "esm": { "version": "3.2.22", "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.22.tgz", diff --git a/site/package.json b/site/package.json index 098450e355..f1987b8293 100644 --- a/site/package.json +++ b/site/package.json @@ -38,7 +38,6 @@ "@sveltejs/svelte-repl": "^0.1.8", "degit": "^2.1.3", "dotenv": "^8.0.0", - "eslint-plugin-svelte3": "^2.5.0", "esm": "^3.2.22", "jimp": "^0.6.0", "mocha": "^6.1.3",