update eslint config & fix lint

This commit is contained in:
baiyongjie 2023-04-15 09:57:50 +08:00
parent 2a34c8fa66
commit 65d2389b2e
5 changed files with 4 additions and 12 deletions

View file

@ -3,7 +3,5 @@ dist
bin bin
docs docs
libraries libraries
spec
spec-es6
coverage coverage
play play

View file

@ -5,8 +5,7 @@ module.exports = {
es2021: true, es2021: true,
node: true, node: true,
}, },
plugins: ['prettier'], // plugins: ['prettier'], // to be activated
extends: ['eslint:recommended', 'airbnb-base', 'plugin:jsonc/recommended-with-jsonc', 'prettier'], extends: ['eslint:recommended', 'airbnb-base', 'plugin:jsonc/recommended-with-jsonc', 'prettier'],
overrides: [ overrides: [
{ {
@ -18,7 +17,6 @@ module.exports = {
parser: 'jsonc-eslint-parser', parser: 'jsonc-eslint-parser',
rules: { rules: {
'jsonc/sort-keys': [ 'jsonc/sort-keys': [
// here is rule (to be deleted)
'off', 'off',
{ {
pathPattern: '^$', pathPattern: '^$',
@ -121,8 +119,6 @@ module.exports = {
sourceType: 'module', sourceType: 'module',
}, },
rules: { rules: {
// hi adam, those rules are //temporary off, you can turn them on one by one to check if we really need it. (to be deleted)
// eslint:recommended // eslint:recommended
'no-unused-vars': 'off', 'no-unused-vars': 'off',
'linebreak-style': 'off', 'linebreak-style': 'off',
@ -136,7 +132,6 @@ module.exports = {
'no-inner-declarations': 'off', 'no-inner-declarations': 'off',
// prettier // prettier
// all about formating, it might take a while to excute it. you can change the config in .prettierrc.js (to be deleted)
'prettier/prettier': ['off', { endOfLine: 'auto' }], 'prettier/prettier': ['off', { endOfLine: 'auto' }],
// airbnb-base // airbnb-base
@ -213,6 +208,6 @@ module.exports = {
'import/no-named-as-default-member': 'off', 'import/no-named-as-default-member': 'off',
yoda: 'off', yoda: 'off',
'no-script-url': 'off', 'no-script-url': 'off',
'no-prototype-builtins':'off'
}, },
}; };

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
npx lint-staged #npx lint-staged

View file

@ -8,7 +8,6 @@ if (config.https) {
// built-in TLS (terminated by trilium) is not supported yet, PRs are welcome // built-in TLS (terminated by trilium) is not supported yet, PRs are welcome
// for reverse proxy terminated TLS this will works since config.https will be false // for reverse proxy terminated TLS this will works since config.https will be false
process.exit(0); process.exit(0);
return;
} }
const port = require('./src/services/port'); const port = require('./src/services/port');

View file

@ -242,7 +242,7 @@ export default class NoteRevisionsDialog extends BasicWidget {
if (this.$content.find('span.math-tex').length > 0) { if (this.$content.find('span.math-tex').length > 0) {
await libraryLoader.requireLibrary(libraryLoader.KATEX); await libraryLoader.requireLibrary(libraryLoader.KATEX);
renderMathInElement($content[0], {trust: true}); renderMathInElement(this.$content[0], {trust: true});
} }
} else if (revisionItem.type === 'code' || revisionItem.type === 'mermaid') { } else if (revisionItem.type === 'code' || revisionItem.type === 'mermaid') {
this.$content.html($("<pre>").text(fullNoteRevision.content)); this.$content.html($("<pre>").text(fullNoteRevision.content));