Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two eslint plugins #24776

Merged
merged 2 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add two eslint plugins
  • Loading branch information
silverwind committed May 17, 2023
commit 0612db3325c0121aa25637ae04ca5b9ff3f327e7
9 changes: 9 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ parserOptions:

plugins:
- "@eslint-community/eslint-plugin-eslint-comments"
- eslint-plugin-array-func
- eslint-plugin-custom-elements
- eslint-plugin-import
- eslint-plugin-jquery
- eslint-plugin-no-jquery
- eslint-plugin-no-use-extend-native
- eslint-plugin-regexp
- eslint-plugin-sonarjs
- eslint-plugin-unicorn
Expand Down Expand Up @@ -59,6 +61,12 @@ rules:
array-bracket-spacing: [2, never]
array-callback-return: [2, {checkForEach: true}]
array-element-newline: [0]
array-func/avoid-reverse: [2]
array-func/from-map: [2]
array-func/no-unnecessary-this-arg: [2]
array-func/prefer-array-from: [2]
array-func/prefer-flat-map: [0] # handled by unicorn/prefer-array-flat-map
array-func/prefer-flat: [0] # handled by unicorn/prefer-array-flat
arrow-body-style: [0]
arrow-parens: [2, always]
arrow-spacing: [2, {before: true, after: true}]
Expand Down Expand Up @@ -444,6 +452,7 @@ rules:
no-unused-private-class-members: [2]
no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, destructuredArrayIgnorePattern: ^_, ignoreRestSiblings: false}]
no-use-before-define: [2, {functions: false, classes: true, variables: true, allowNamedExports: true}]
no-use-extend-native/no-use-extend-native: [2]
no-useless-backreference: [2]
no-useless-call: [2]
no-useless-catch: [2]
Expand Down
113 changes: 113 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@
"@stoplight/spectral-cli": "6.6.0",
"@vitejs/plugin-vue": "4.2.3",
"eslint": "8.40.0",
"eslint-plugin-array-func": "3.1.8",
"eslint-plugin-custom-elements": "0.0.8",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jquery": "1.5.1",
"eslint-plugin-no-jquery": "2.7.0",
"eslint-plugin-no-use-extend-native": "0.5.0",
"eslint-plugin-regexp": "1.15.0",
"eslint-plugin-sonarjs": "0.19.0",
"eslint-plugin-unicorn": "47.0.0",
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/copycontent.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function initCopyContent() {
}
} else { // text, read from DOM
const lineEls = document.querySelectorAll('.file-view .lines-code');
content = Array.from(lineEls).map((el) => el.textContent).join('');
content = Array.from(lineEls, (el) => el.textContent).join('');
}

// try copy original first, if that fails and it's an image, convert it to png
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/repo-projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function moveIssue({item, from, to, oldIndex}) {
updateIssueCount(to);

const columnSorting = {
issues: [...columnCards].map((card, i) => ({
issues: Array.from(columnCards, (card, i) => ({
issueID: parseInt($(card).attr('data-issue')),
sorting: i
}))
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/utils/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import emojis from '../../../assets/emoji.json';
const maxMatches = 6;

function sortAndReduce(map) {
const sortedMap = new Map([...map.entries()].sort((a, b) => a[1] - b[1]));
const sortedMap = new Map(Array.from(map.entries()).sort((a, b) => a[1] - b[1]));
return Array.from(sortedMap.keys()).slice(0, maxMatches);
}

Expand Down