1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-23 00:54:28 +00:00

Update JS dependencies, adjust eslint config (#17904)

- Update all JS dependencies to latest versions
- Add new lint rules, enable es2022 eslint parser features
- Disable github/no-then, I feel the rule was too restricting
This commit is contained in:
silverwind 2021-12-03 22:43:14 -08:00 committed by GitHub
parent c7c723c548
commit f7094c8161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 1490 additions and 1252 deletions

View File

@ -6,7 +6,7 @@ ignorePatterns:
parserOptions: parserOptions:
sourceType: module sourceType: module
ecmaVersion: 2021 ecmaVersion: latest
plugins: plugins:
- eslint-plugin-unicorn - eslint-plugin-unicorn
@ -109,7 +109,7 @@ rules:
github/no-implicit-buggy-globals: [0] github/no-implicit-buggy-globals: [0]
github/no-inner-html: [0] github/no-inner-html: [0]
github/no-innerText: [2] github/no-innerText: [2]
github/no-then: [2] github/no-then: [0]
github/no-useless-passive: [2] github/no-useless-passive: [2]
github/prefer-observers: [0] github/prefer-observers: [0]
github/require-passive-events: [2] github/require-passive-events: [2]
@ -384,6 +384,7 @@ rules:
unicorn/no-array-instanceof: [0] unicorn/no-array-instanceof: [0]
unicorn/no-array-method-this-argument: [2] unicorn/no-array-method-this-argument: [2]
unicorn/no-array-push-push: [2] unicorn/no-array-push-push: [2]
unicorn/no-await-expression-member: [0]
unicorn/no-console-spaces: [0] unicorn/no-console-spaces: [0]
unicorn/no-document-cookie: [2] unicorn/no-document-cookie: [2]
unicorn/no-empty-file: [2] unicorn/no-empty-file: [2]
@ -419,6 +420,7 @@ rules:
unicorn/prefer-array-index-of: [2] unicorn/prefer-array-index-of: [2]
unicorn/prefer-array-some: [2] unicorn/prefer-array-some: [2]
unicorn/prefer-at: [0] unicorn/prefer-at: [0]
unicorn/prefer-code-point: [2]
unicorn/prefer-dataset: [2] unicorn/prefer-dataset: [2]
unicorn/prefer-date-now: [2] unicorn/prefer-date-now: [2]
unicorn/prefer-default-parameters: [0] unicorn/prefer-default-parameters: [0]

View File

@ -80,5 +80,5 @@ async function main() {
]); ]);
} }
main().then(exit).catch(exit); // eslint-disable-line github/no-then main().then(exit).catch(exit);

View File

@ -54,5 +54,5 @@ async function main() {
]); ]);
} }
main().then(exit).catch(exit); // eslint-disable-line github/no-then main().then(exit).catch(exit);

2689
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,12 +6,12 @@
"node": ">= 12.17.0" "node": ">= 12.17.0"
}, },
"dependencies": { "dependencies": {
"@claviska/jquery-minicolors": "2.3.5", "@claviska/jquery-minicolors": "2.3.6",
"@primer/octicons": "16.1.1", "@primer/octicons": "16.1.1",
"add-asset-webpack-plugin": "2.0.1", "add-asset-webpack-plugin": "2.0.1",
"codemirror": "5.63.3", "codemirror": "5.64.0",
"css-loader": "6.5.1", "css-loader": "6.5.1",
"dropzone": "6.0.0-beta.1", "dropzone": "6.0.0-beta.2",
"easymde": "2.15.0", "easymde": "2.15.0",
"esbuild-loader": "2.16.0", "esbuild-loader": "2.16.0",
"escape-goat": "4.0.0", "escape-goat": "4.0.0",
@ -22,40 +22,40 @@
"less": "4.1.2", "less": "4.1.2",
"less-loader": "10.2.0", "less-loader": "10.2.0",
"license-checker-webpack-plugin": "0.2.1", "license-checker-webpack-plugin": "0.2.1",
"mermaid": "8.13.3", "mermaid": "8.13.4",
"mini-css-extract-plugin": "2.4.4", "mini-css-extract-plugin": "2.4.5",
"monaco-editor": "0.30.1", "monaco-editor": "0.30.1",
"monaco-editor-webpack-plugin": "6.0.0", "monaco-editor-webpack-plugin": "6.0.0",
"pretty-ms": "7.0.1", "pretty-ms": "7.0.1",
"sortablejs": "1.14.0", "sortablejs": "1.14.0",
"swagger-ui-dist": "4.1.0", "swagger-ui-dist": "4.1.2",
"tributejs": "5.1.3", "tributejs": "5.1.3",
"vue": "2.6.14", "vue": "2.6.14",
"vue-bar-graph": "1.3.0", "vue-bar-graph": "1.3.0",
"vue-calendar-heatmap": "0.8.4", "vue-calendar-heatmap": "0.8.4",
"vue-loader": "15.9.8", "vue-loader": "15.9.8",
"vue-template-compiler": "2.6.14", "vue-template-compiler": "2.6.14",
"webpack": "5.63.0", "webpack": "5.64.4",
"webpack-cli": "4.9.1", "webpack-cli": "4.9.1",
"workbox-routing": "6.3.0", "workbox-routing": "6.4.2",
"workbox-strategies": "6.3.0", "workbox-strategies": "6.4.2",
"worker-loader": "3.0.8", "worker-loader": "3.0.8",
"wrap-ansi": "8.0.1" "wrap-ansi": "8.0.1"
}, },
"devDependencies": { "devDependencies": {
"editorconfig-checker": "4.0.2", "editorconfig-checker": "4.0.2",
"eslint": "8.2.0", "eslint": "8.3.0",
"eslint-plugin-github": "4.3.5", "eslint-plugin-github": "4.3.5",
"eslint-plugin-html": "6.2.0", "eslint-plugin-html": "6.2.0",
"eslint-plugin-import": "2.25.3", "eslint-plugin-import": "2.25.3",
"eslint-plugin-unicorn": "38.0.1", "eslint-plugin-unicorn": "39.0.0",
"eslint-plugin-vue": "8.0.3", "eslint-plugin-vue": "8.1.1",
"jest": "27.3.1", "jest": "27.4.3",
"jest-extended": "1.1.0", "jest-extended": "1.2.0",
"jest-raw-loader": "1.0.1", "jest-raw-loader": "1.0.1",
"postcss-less": "5.0.0", "postcss-less": "5.0.0",
"stylelint": "14.0.1", "stylelint": "14.1.0",
"stylelint-config-standard": "23.0.0", "stylelint-config-standard": "24.0.0",
"svgo": "2.8.0", "svgo": "2.8.0",
"updates": "12.2.2" "updates": "12.2.2"
}, },

View File

@ -28,7 +28,7 @@ export function initCommonIssue() {
action, action,
issueIDs, issueIDs,
elementId elementId
).then(() => { // eslint-disable-line github/no-then ).then(() => {
// NOTICE: This reset of checkbox state targets Firefox caching behaviour, as the // NOTICE: This reset of checkbox state targets Firefox caching behaviour, as the
// checkboxes stay checked after reload // checkboxes stay checked after reload
if (action === 'close' || action === 'open') { if (action === 'close' || action === 'open') {

View File

@ -361,7 +361,7 @@ export function initRepoIssueComments() {
isChecked ? 'detach' : 'attach', isChecked ? 'detach' : 'attach',
issueId, issueId,
id, id,
).then(() => window.location.reload()); // eslint-disable-line github/no-then ).then(() => window.location.reload());
}); });
$('.dismiss-review-btn').on('click', function (e) { $('.dismiss-review-btn').on('click', function (e) {

View File

@ -162,7 +162,7 @@ export function initRepoCommentForm() {
'clear', 'clear',
$listMenu.data('issue-id'), $listMenu.data('issue-id'),
'', '',
).then(() => window.location.reload()); // eslint-disable-line github/no-then ).then(() => window.location.reload());
} }
$(this).parent().find('.item').each(function () { $(this).parent().find('.item').each(function () {
@ -205,7 +205,7 @@ export function initRepoCommentForm() {
'', '',
$menu.data('issue-id'), $menu.data('issue-id'),
$(this).data('id'), $(this).data('id'),
).then(() => window.location.reload()); // eslint-disable-line github/no-then ).then(() => window.location.reload());
} }
let icon = ''; let icon = '';
@ -238,7 +238,7 @@ export function initRepoCommentForm() {
'', '',
$menu.data('issue-id'), $menu.data('issue-id'),
$(this).data('id'), $(this).data('id'),
).then(() => window.location.reload()); // eslint-disable-line github/no-then ).then(() => window.location.reload());
} }
$list.find('.selected').html(''); $list.find('.selected').html('');

View File

@ -1,4 +1,3 @@
/* eslint-disable github/no-then */
const {appSubUrl, csrfToken} = window.config; const {appSubUrl, csrfToken} = window.config;
export function initUserAuthU2fAuth() { export function initUserAuthU2fAuth() {