Skip to content

Commit 5d049f4

Browse files
committed
refactor(lint): fix linting errors
fix errors thrown by linter
1 parent f560372 commit 5d049f4

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

conf/webpack.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ module.exports = {
3838
},
3939
resolve: {
4040
extensions: ['.ts', '.js'],
41-
modules: [
42-
path.join(__dirname, '../util'),
43-
path.join(__dirname, '../node_modules')
44-
],
41+
modules: [path.join(__dirname, '../util'), path.join(__dirname, '../node_modules')],
4542
alias: {
4643
'@': path.resolve(__dirname, '../')
4744
},

conf/webpack.tests.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ module.exports = {
3636
},
3737
resolve: {
3838
extensions: ['.ts', '.js'],
39-
modules: [
40-
path.join(__dirname, '../test'),
41-
path.join(__dirname, '../node_modules')
42-
],
39+
modules: [path.join(__dirname, '../test'), path.join(__dirname, '../node_modules')],
4340
alias: {
4441
'@': path.resolve(__dirname, '../')
4542
},

eslint.config.cjs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const pluginNode = require('eslint-plugin-n');
3030
const pluginPrettier = require('eslint-plugin-prettier');
3131
const pluginPromise = require('eslint-plugin-promise');
3232
const mochaPlugin = require('eslint-plugin-mocha');
33+
const tsPlugin = require('@typescript-eslint/eslint-plugin');
3334

3435
/*
3536
Globals
@@ -70,7 +71,8 @@ module.exports = [{
7071
'mocha': mochaPlugin,
7172
'n': pluginNode,
7273
'prettier': pluginPrettier,
73-
'promise': pluginPromise
74+
'promise': pluginPromise,
75+
'@typescript-eslint': tsPlugin
7476
},
7577

7678
linterOptions: {
@@ -100,7 +102,17 @@ module.exports = [{
100102
sourceType: 'module',
101103
},
102104
rules: {
103-
// eslint / js rules
105+
106+
/*
107+
Turn off original and add back typescript version
108+
*/
109+
110+
"no-unused-vars": 'off',
111+
"@typescript-eslint/no-unused-vars": ["error"],
112+
113+
"no-redeclare": 'off',
114+
"@typescript-eslint/no-redeclare": "error",
115+
104116
'array-callback-return': 'error',
105117
'curly': 'error',
106118
'eqeqeq': 'error',
@@ -118,7 +130,6 @@ module.exports = [{
118130
'no-throw-literal': 'off',
119131
'no-unneeded-ternary': 'error',
120132
'no-unused-expressions': 'off',
121-
'no-unused-vars': 'error',
122133
'no-useless-constructor': 'error',
123134
'no-useless-escape': 'off',
124135
'no-var': 'error',

lib/format/kdbx-credentials.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
12
import * as XmlUtils from '../utils/xml-utils';
23
import * as CryptoEngine from '../crypto/crypto-engine';
34
import { ProtectedValue } from '../crypto/protected-value';

lib/utils/xml-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export function getText(node: Node | null): string | undefined {
164164
if (!node?.childNodes) {
165165
return undefined;
166166
}
167-
return node.protectedValue ? node.protectedValue.getText() : node.textContent ?? undefined;
167+
return node.protectedValue ? node.protectedValue.getText() : (node.textContent ?? undefined);
168168
}
169169

170170
export function setText(node: Node, text: string | undefined): void {

0 commit comments

Comments
 (0)