forked from p85947160/gitea
Update JS deps and linting config (#12295)
- update js deps to latest versions - remove eslint-plugin-sonarjs to prevent a warning on install. can be added again once it's updated to support eslint 7.x - enable new linting rules from eslint-plugin-unicorn Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
8d6fa00da0
commit
78cbd0ca72
28
.eslintrc
28
.eslintrc
|
@ -11,7 +11,6 @@ parserOptions:
|
||||||
plugins:
|
plugins:
|
||||||
- eslint-plugin-unicorn
|
- eslint-plugin-unicorn
|
||||||
- eslint-plugin-import
|
- eslint-plugin-import
|
||||||
- eslint-plugin-sonarjs
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
browser: true
|
browser: true
|
||||||
|
@ -311,31 +310,6 @@ rules:
|
||||||
semi-spacing: [2, {before: false, after: true}]
|
semi-spacing: [2, {before: false, after: true}]
|
||||||
semi-style: [2, last]
|
semi-style: [2, last]
|
||||||
semi: [2, always, {omitLastInOneLineBlock: true}]
|
semi: [2, always, {omitLastInOneLineBlock: true}]
|
||||||
sonarjs/cognitive-complexity: [0]
|
|
||||||
sonarjs/max-switch-cases: [0]
|
|
||||||
sonarjs/no-all-duplicated-branches: [2]
|
|
||||||
sonarjs/no-collapsible-if: [0]
|
|
||||||
sonarjs/no-collection-size-mischeck: [2]
|
|
||||||
sonarjs/no-duplicate-string: [0]
|
|
||||||
sonarjs/no-duplicated-branches: [0]
|
|
||||||
sonarjs/no-element-overwrite: [2]
|
|
||||||
sonarjs/no-extra-arguments: [0]
|
|
||||||
sonarjs/no-identical-conditions: [2]
|
|
||||||
sonarjs/no-identical-expressions: [0]
|
|
||||||
sonarjs/no-identical-functions: [0]
|
|
||||||
sonarjs/no-inverted-boolean-check: [2]
|
|
||||||
sonarjs/no-one-iteration-loop: [2]
|
|
||||||
sonarjs/no-redundant-boolean: [2]
|
|
||||||
sonarjs/no-redundant-jump: [0]
|
|
||||||
sonarjs/no-same-line-conditional: [2]
|
|
||||||
sonarjs/no-small-switch: [0]
|
|
||||||
sonarjs/no-unused-collection: [2]
|
|
||||||
sonarjs/no-use-of-empty-return-value: [2]
|
|
||||||
sonarjs/no-useless-catch: [0]
|
|
||||||
sonarjs/prefer-immediate-return: [0]
|
|
||||||
sonarjs/prefer-object-literal: [2]
|
|
||||||
sonarjs/prefer-single-boolean-return: [0]
|
|
||||||
sonarjs/prefer-while: [2]
|
|
||||||
sort-imports: [0]
|
sort-imports: [0]
|
||||||
sort-keys: [0]
|
sort-keys: [0]
|
||||||
sort-vars: [0]
|
sort-vars: [0]
|
||||||
|
@ -371,6 +345,7 @@ rules:
|
||||||
unicorn/no-nested-ternary: [0]
|
unicorn/no-nested-ternary: [0]
|
||||||
unicorn/no-new-buffer: [0]
|
unicorn/no-new-buffer: [0]
|
||||||
unicorn/no-null: [0]
|
unicorn/no-null: [0]
|
||||||
|
unicorn/no-object-as-default-parameter: [2]
|
||||||
unicorn/no-process-exit: [0]
|
unicorn/no-process-exit: [0]
|
||||||
unicorn/no-reduce: [2]
|
unicorn/no-reduce: [2]
|
||||||
unicorn/no-unreadable-array-destructuring: [0]
|
unicorn/no-unreadable-array-destructuring: [0]
|
||||||
|
@ -380,6 +355,7 @@ rules:
|
||||||
unicorn/no-zero-fractions: [2]
|
unicorn/no-zero-fractions: [2]
|
||||||
unicorn/number-literal-case: [0]
|
unicorn/number-literal-case: [0]
|
||||||
unicorn/prefer-add-event-listener: [2]
|
unicorn/prefer-add-event-listener: [2]
|
||||||
|
unicorn/prefer-array-find: [2]
|
||||||
unicorn/prefer-dataset: [2]
|
unicorn/prefer-dataset: [2]
|
||||||
unicorn/prefer-event-key: [2]
|
unicorn/prefer-event-key: [2]
|
||||||
unicorn/prefer-includes: [2]
|
unicorn/prefer-includes: [2]
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -609,6 +609,7 @@ npm-update: node-check | node_modules
|
||||||
npx updates -cu
|
npx updates -cu
|
||||||
rm -rf node_modules package-lock.json
|
rm -rf node_modules package-lock.json
|
||||||
npm install --package-lock
|
npm install --package-lock
|
||||||
|
@touch node_modules
|
||||||
|
|
||||||
.PHONY: fomantic
|
.PHONY: fomantic
|
||||||
fomantic: $(FOMANTIC_DEST)
|
fomantic: $(FOMANTIC_DEST)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
|
@ -5,18 +5,18 @@
|
||||||
"node": ">= 10.13.0"
|
"node": ">= 10.13.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "7.10.4",
|
"@babel/core": "7.10.5",
|
||||||
"@babel/plugin-proposal-object-rest-spread": "7.10.4",
|
"@babel/plugin-proposal-object-rest-spread": "7.10.4",
|
||||||
"@babel/plugin-transform-runtime": "7.10.4",
|
"@babel/plugin-transform-runtime": "7.10.5",
|
||||||
"@babel/preset-env": "7.10.4",
|
"@babel/preset-env": "7.10.4",
|
||||||
"@babel/runtime": "7.10.4",
|
"@babel/runtime": "7.10.5",
|
||||||
"@primer/octicons": "10.0.0",
|
"@primer/octicons": "10.0.0",
|
||||||
"babel-loader": "8.1.0",
|
"babel-loader": "8.1.0",
|
||||||
"clipboard": "2.0.6",
|
"clipboard": "2.0.6",
|
||||||
"core-js": "3.6.5",
|
"core-js": "3.6.5",
|
||||||
"css-loader": "3.6.0",
|
"css-loader": "4.0.0",
|
||||||
"cssnano-webpack-plugin": "1.0.3",
|
"cssnano-webpack-plugin": "1.0.3",
|
||||||
"dropzone": "5.7.1",
|
"dropzone": "5.7.2",
|
||||||
"fast-glob": "3.2.4",
|
"fast-glob": "3.2.4",
|
||||||
"file-loader": "6.0.0",
|
"file-loader": "6.0.0",
|
||||||
"fomantic-ui": "2.8.6",
|
"fomantic-ui": "2.8.6",
|
||||||
|
@ -24,23 +24,23 @@
|
||||||
"jquery": "3.5.1",
|
"jquery": "3.5.1",
|
||||||
"jquery.are-you-sure": "1.9.0",
|
"jquery.are-you-sure": "1.9.0",
|
||||||
"less-loader": "6.2.0",
|
"less-loader": "6.2.0",
|
||||||
"license-webpack-plugin": "2.2.0",
|
"license-webpack-plugin": "2.3.0",
|
||||||
"mermaid": "8.6.3",
|
"mermaid": "8.6.4",
|
||||||
"mini-css-extract-plugin": "0.9.0",
|
"mini-css-extract-plugin": "0.9.0",
|
||||||
"monaco-editor": "0.20.0",
|
"monaco-editor": "0.20.0",
|
||||||
"monaco-editor-webpack-plugin": "1.9.0",
|
"monaco-editor-webpack-plugin": "1.9.0",
|
||||||
"postcss-loader": "3.0.0",
|
"postcss-loader": "3.0.0",
|
||||||
"postcss-preset-env": "6.7.0",
|
"postcss-preset-env": "6.7.0",
|
||||||
"raw-loader": "4.0.1",
|
"raw-loader": "4.0.1",
|
||||||
"swagger-ui": "3.28.0",
|
"swagger-ui": "3.30.2",
|
||||||
"terser-webpack-plugin": "3.0.6",
|
"terser-webpack-plugin": "3.0.8",
|
||||||
"tributejs": "5.1.3",
|
"tributejs": "5.1.3",
|
||||||
"vue": "2.6.11",
|
"vue": "2.6.11",
|
||||||
"vue-bar-graph": "1.2.0",
|
"vue-bar-graph": "1.2.0",
|
||||||
"vue-calendar-heatmap": "0.8.4",
|
"vue-calendar-heatmap": "0.8.4",
|
||||||
"vue-loader": "15.9.3",
|
"vue-loader": "15.9.3",
|
||||||
"vue-template-compiler": "2.6.11",
|
"vue-template-compiler": "2.6.11",
|
||||||
"webpack": "4.43.0",
|
"webpack": "4.44.0",
|
||||||
"webpack-cli": "3.3.12",
|
"webpack-cli": "3.3.12",
|
||||||
"webpack-fix-style-only-entries": "0.5.1",
|
"webpack-fix-style-only-entries": "0.5.1",
|
||||||
"workbox-routing": "5.1.3",
|
"workbox-routing": "5.1.3",
|
||||||
|
@ -49,14 +49,13 @@
|
||||||
"wrap-ansi": "7.0.0"
|
"wrap-ansi": "7.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "7.4.0",
|
"eslint": "7.5.0",
|
||||||
"eslint-plugin-import": "2.22.0",
|
"eslint-plugin-import": "2.22.0",
|
||||||
"eslint-plugin-sonarjs": "0.5.0",
|
"eslint-plugin-unicorn": "21.0.0",
|
||||||
"eslint-plugin-unicorn": "20.1.0",
|
|
||||||
"stylelint": "13.6.1",
|
"stylelint": "13.6.1",
|
||||||
"stylelint-config-standard": "20.0.0",
|
"stylelint-config-standard": "20.0.0",
|
||||||
"svgo": "1.3.2",
|
"svgo": "1.3.2",
|
||||||
"updates": "10.2.15"
|
"updates": "10.3.3"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"defaults",
|
"defaults",
|
||||||
|
|
|
@ -21,8 +21,8 @@ for (const path of glob('web_src/less/themes/*.less')) {
|
||||||
|
|
||||||
const isProduction = process.env.NODE_ENV !== 'development';
|
const isProduction = process.env.NODE_ENV !== 'development';
|
||||||
|
|
||||||
const filterCssImport = (parsedImport, cssFile) => {
|
const filterCssImport = (url, ...args) => {
|
||||||
const url = parsedImport && parsedImport.url ? parsedImport.url : parsedImport;
|
const cssFile = args[1] || args[0]; // resourcePath is 2nd argument for url and 3rd for import
|
||||||
const importedFile = url.replace(/[?#].+/, '').toLowerCase();
|
const importedFile = url.replace(/[?#].+/, '').toLowerCase();
|
||||||
|
|
||||||
if (cssFile.includes('fomantic')) {
|
if (cssFile.includes('fomantic')) {
|
||||||
|
|
Loading…
Reference in New Issue