diff --git a/.eslintrc.js b/.eslintrc.js index b875f8e46c..ac4ee8ec1d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,22 +23,6 @@ module.exports = { 'prettier/vue', ], rules: { - 'no-magic-numbers': [ - 'warn', - { ignoreArrayIndexes: true, ignore: [0, 1, 2, -1, 10] }, - ], - 'no-param-reassign': 'warn', - 'no-console': process.env.NODE_ENV === 'development' ? 'off' : 'error', - 'no-debugger': process.env.NODE_ENV === 'development' ? 'off' : 'error', - 'vue/attribute-hyphenation': ['error', 'never'], - 'vue/require-default-prop': 'off', - 'vue/require-component-is': 'warn', - 'vue/html-indent': 'off', - 'sonarjs/no-duplicate-string': 'warn', - '@typescript-eslint/member-delimiter-style': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/no-namespace': 'off', - 'prettier/prettier': 'warn', 'import/order': [ 'warn', { @@ -49,8 +33,25 @@ module.exports = { 'newlines-between': 'always', }, ], + 'no-console': process.env.NODE_ENV === 'development' ? 'off' : 'error', + 'no-debugger': process.env.NODE_ENV === 'development' ? 'off' : 'error', + 'no-magic-numbers': [ + 'warn', + { ignoreArrayIndexes: true, ignore: [0, 1, 2, -1, 10] }, + ], + 'no-param-reassign': 'warn', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/member-delimiter-style': 'off', + '@typescript-eslint/no-extra-semi': 'off', // conflicts with prettier + '@typescript-eslint/no-namespace': 'off', + 'sonarjs/no-duplicate-string': 'warn', + 'prettier/prettier': 'warn', 'vue/attribute-hyphenation': ['error', 'never'], 'vue/attributes-order': ['error', { alphabetical: true }], + 'vue/html-indent': 'off', + 'vue/require-component-is': 'warn', + 'vue/require-default-prop': 'off', }, overrides: [ { diff --git a/package.json b/package.json index 13a261ab5a..72ceddc874 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ } ], "dependencies": { - "typescript": "^3.9.6" + "typescript": "4.3" }, "devDependencies": { "@babel/core": "7.x", @@ -57,8 +57,8 @@ "@babel/preset-env": "^7.11.0", "@babel/preset-typescript": "^7.10.4", "@types/jest": "^26.0.20", - "@typescript-eslint/eslint-plugin": "^2.26.0", - "@typescript-eslint/parser": "^2.26.0", + "@typescript-eslint/eslint-plugin": "^4.31.0", + "@typescript-eslint/parser": "^4.31.0", "@vue/eslint-config-typescript": "^5.0.2", "@vue/test-utils": "^1.1.2", "autoprefixer": "^9.8.5", diff --git a/packages/documentation/components/ComponentInfo.vue b/packages/documentation/components/ComponentInfo.vue index aa612a90bc..50bd122179 100644 --- a/packages/documentation/components/ComponentInfo.vue +++ b/packages/documentation/components/ComponentInfo.vue @@ -253,7 +253,7 @@ export default defineComponent<{ return result }), showProps: ref(false), - stringifyDefault: (defaultValue: Function | unknown) => + stringifyDefault: (defaultValue: (() => unknown) | unknown) => typeof defaultValue === 'function' ? `${JSON.stringify(defaultValue())} *` : JSON.stringify(defaultValue), diff --git a/packages/documentation/pages/changelog.vue b/packages/documentation/pages/changelog.vue index a886ef665d..abf8ffa75b 100644 --- a/packages/documentation/pages/changelog.vue +++ b/packages/documentation/pages/changelog.vue @@ -112,9 +112,9 @@ const convertPoundToIssueLink = (string: string) => '[#$1](https://github.com/3YOURMIND/kotti/issues/$1)', ) -// disable ban-ts-ignore because vscode sees this as an error but nuxt doesn’t -// eslint-disable-next-line @typescript-eslint/ban-ts-ignore -// @ts-ignored layout is not added to the type definition of defineComponent +// disable ban-ts-comment because vscode sees this as an error but nuxt doesn’t +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore layout is not added to the type definition of defineComponent export default defineComponent({ name: 'DocumentationPageChangelog', layout: 'fullpage', @@ -129,7 +129,6 @@ export default defineComponent({ releases.value = ( await octokit.repos.listReleases({ owner: '3yourmind', - // eslint-disable-next-line @typescript-eslint/camelcase per_page: 1000, repo: 'kotti', }) diff --git a/packages/documentation/pages/foundations/units.vue b/packages/documentation/pages/foundations/units.vue index ab22496a5e..697ab3b023 100644 --- a/packages/documentation/pages/foundations/units.vue +++ b/packages/documentation/pages/foundations/units.vue @@ -36,9 +36,9 @@ The following 3 types of margins or paddings are suggested: