Lint bug Fix
This commit is contained in:
ShahanaFarooqui 2024-06-10 16:41:37 -07:00 committed by GitHub
parent f01815bd04
commit b6dbd23ae7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 31 additions and 33 deletions

View File

@ -24,7 +24,6 @@ typings/
_config.yml _config.yml
.classpath .classpath
.DS_Store .DS_Store
.eslintrc.json
.gitattributes .gitattributes
.gitignore .gitignore
.idea .idea

View File

@ -23,6 +23,8 @@
"plugin:@angular-eslint/template/process-inline-templates" "plugin:@angular-eslint/template/process-inline-templates"
], ],
"rules": { "rules": {
"@angular-eslint/component-selector": ["error", { "prefix": "rtl", "style": "kebab-case", "type": "element" }],
"@angular-eslint/directive-selector": ["error", { "style": "camelCase", "type": "attribute" }],
"@angular-eslint/consistent-component-styles": "off", "@angular-eslint/consistent-component-styles": "off",
"@angular-eslint/prefer-on-push-component-change-detection": "off", "@angular-eslint/prefer-on-push-component-change-detection": "off",
"@angular-eslint/prefer-standalone": "off", "@angular-eslint/prefer-standalone": "off",
@ -190,8 +192,6 @@
], ],
"rules": { "rules": {
"@angular-eslint/arrow-body-style": "off", "@angular-eslint/arrow-body-style": "off",
"@angular-eslint/component-selector": ["error", { "prefix": "rtl", "style": "kebab-case", "type": "element" }],
"@angular-eslint/directive-selector": ["error", { "style": "camelCase", "type": "attribute" }],
"@angular-eslint/template/accessibility-elements-content": "off", "@angular-eslint/template/accessibility-elements-content": "off",
"@angular-eslint/template/accessibility-interactive-supports-focus": "off", "@angular-eslint/template/accessibility-interactive-supports-focus": "off",
"@angular-eslint/template/button-has-type": "off", "@angular-eslint/template/button-has-type": "off",

View File

@ -59,12 +59,9 @@ jobs:
if: steps.cache-npm-packages.outputs.cache-hit != 'true' if: steps.cache-npm-packages.outputs.cache-hit != 'true'
run: npm ci --legacy-peer-deps run: npm ci --legacy-peer-deps
- name: Lint Scripts - name: Lint Src and Server
run: npm run lint run: npm run lint
- name: Lint Server Script
run: npm run lintServer
test: test:
name: Test name: Test
runs-on: ubuntu-latest runs-on: ubuntu-latest

13
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,13 @@
{
"eslint.enable": true,
"eslint.validate": [
"typescript",
"HTML"
],
"eslint.options": {
"configFile": ".eslintrc.json"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}

View File

@ -111,16 +111,6 @@
], ],
"scripts": [] "scripts": []
} }
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"eslintConfig": ".eslintrc.json",
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
} }
} }
} }

View File

@ -1,5 +1,4 @@
import request from 'request-promise'; import request from 'request-promise';
import { Database } from '../../utils/database.js';
import { Logger } from '../../utils/logger.js'; import { Logger } from '../../utils/logger.js';
import { Common } from '../../utils/common.js'; import { Common } from '../../utils/common.js';
import { CLWSClient } from './webSocketClient.js'; import { CLWSClient } from './webSocketClient.js';
@ -7,7 +6,6 @@ let options = null;
const logger = Logger; const logger = Logger;
const common = Common; const common = Common;
const clWsClient = CLWSClient; const clWsClient = CLWSClient;
const databaseService = Database;
export const getInfo = (req, res, next) => { export const getInfo = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting Core Lightning Node Information..' }); logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting Core Lightning Node Information..' });
common.logEnvVariables(req); common.logEnvVariables(req);

View File

@ -1,5 +1,4 @@
import request from 'request-promise'; import request from 'request-promise';
import { Database } from '../../utils/database.js';
import { Logger } from '../../utils/logger.js'; import { Logger } from '../../utils/logger.js';
import { Common } from '../../utils/common.js'; import { Common } from '../../utils/common.js';
import { ECLWSClient } from './webSocketClient.js'; import { ECLWSClient } from './webSocketClient.js';
@ -7,7 +6,6 @@ let options = null;
const logger = Logger; const logger = Logger;
const common = Common; const common = Common;
const eclWsClient = ECLWSClient; const eclWsClient = ECLWSClient;
const databaseService = Database;
export const getInfo = (req, res, next) => { export const getInfo = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting Eclair Node Information..' }); logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting Eclair Node Information..' });
common.logEnvVariables(req); common.logEnvVariables(req);

View File

@ -1,5 +1,4 @@
import request from 'request-promise'; import request from 'request-promise';
import { Database } from '../../utils/database.js';
import { Logger } from '../../utils/logger.js'; import { Logger } from '../../utils/logger.js';
import { Common } from '../../utils/common.js'; import { Common } from '../../utils/common.js';
import { LNDWSClient } from './webSocketClient.js'; import { LNDWSClient } from './webSocketClient.js';
@ -7,7 +6,6 @@ let options = null;
const logger = Logger; const logger = Logger;
const common = Common; const common = Common;
const lndWsClient = LNDWSClient; const lndWsClient = LNDWSClient;
const databaseService = Database;
export const getInfo = (req, res, next) => { export const getInfo = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting LND Node Information..' }); logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting LND Node Information..' });
common.logEnvVariables(req); common.logEnvVariables(req);

11
eslint.config.js Normal file
View File

@ -0,0 +1,11 @@
import { FlatCompat } from '@eslint/eslintrc';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
const compat = new FlatCompat({
baseDirectory: dirname(fileURLToPath(import.meta.url))
});
export default [
...compat.extends('./.eslintrc.json')
];

1
package-lock.json generated
View File

@ -58,6 +58,7 @@
"@angular/platform-browser": "^18.0.1", "@angular/platform-browser": "^18.0.1",
"@angular/platform-browser-dynamic": "^18.0.1", "@angular/platform-browser-dynamic": "^18.0.1",
"@angular/router": "^18.0.1", "@angular/router": "^18.0.1",
"@eslint/eslintrc": "^3.1.0",
"@fortawesome/angular-fontawesome": "^0.15.0", "@fortawesome/angular-fontawesome": "^0.15.0",
"@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-regular-svg-icons": "^6.5.2", "@fortawesome/free-regular-svg-icons": "^6.5.2",

View File

@ -17,8 +17,7 @@
"serverUbuntu": "NODE_ENV=development nodemon --watch backend --watch server ./rtl.js", "serverUbuntu": "NODE_ENV=development nodemon --watch backend --watch server ./rtl.js",
"testdev": "ng test --watch=true --code-coverage", "testdev": "ng test --watch=true --code-coverage",
"test": "ng test --watch=false --browsers=ChromeHeadless", "test": "ng test --watch=false --browsers=ChromeHeadless",
"lint": "ng lint", "lint": "eslint"
"lintServer": "eslint ./server/**/* --ext .ts"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
@ -71,6 +70,7 @@
"@angular/platform-browser": "^18.0.1", "@angular/platform-browser": "^18.0.1",
"@angular/platform-browser-dynamic": "^18.0.1", "@angular/platform-browser-dynamic": "^18.0.1",
"@angular/router": "^18.0.1", "@angular/router": "^18.0.1",
"@eslint/eslintrc": "^3.1.0",
"@fortawesome/angular-fontawesome": "^0.15.0", "@fortawesome/angular-fontawesome": "^0.15.0",
"@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-regular-svg-icons": "^6.5.2", "@fortawesome/free-regular-svg-icons": "^6.5.2",

View File

@ -1,5 +1,4 @@
import request from 'request-promise'; import request from 'request-promise';
import { Database, DatabaseService } from '../../utils/database.js';
import { Logger, LoggerService } from '../../utils/logger.js'; import { Logger, LoggerService } from '../../utils/logger.js';
import { Common, CommonService } from '../../utils/common.js'; import { Common, CommonService } from '../../utils/common.js';
import { CLWSClient, CLWebSocketClient } from './webSocketClient.js'; import { CLWSClient, CLWebSocketClient } from './webSocketClient.js';
@ -8,7 +7,6 @@ let options = null;
const logger: LoggerService = Logger; const logger: LoggerService = Logger;
const common: CommonService = Common; const common: CommonService = Common;
const clWsClient: CLWebSocketClient = CLWSClient; const clWsClient: CLWebSocketClient = CLWSClient;
const databaseService: DatabaseService = Database;
export const getInfo = (req, res, next) => { export const getInfo = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting Core Lightning Node Information..' }); logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting Core Lightning Node Information..' });

View File

@ -1,5 +1,4 @@
import request from 'request-promise'; import request from 'request-promise';
import { Database, DatabaseService } from '../../utils/database.js';
import { Logger, LoggerService } from '../../utils/logger.js'; import { Logger, LoggerService } from '../../utils/logger.js';
import { Common, CommonService } from '../../utils/common.js'; import { Common, CommonService } from '../../utils/common.js';
import { ECLWSClient, ECLWebSocketClient } from './webSocketClient.js'; import { ECLWSClient, ECLWebSocketClient } from './webSocketClient.js';
@ -8,7 +7,6 @@ let options = null;
const logger: LoggerService = Logger; const logger: LoggerService = Logger;
const common: CommonService = Common; const common: CommonService = Common;
const eclWsClient: ECLWebSocketClient = ECLWSClient; const eclWsClient: ECLWebSocketClient = ECLWSClient;
const databaseService: DatabaseService = Database;
export const getInfo = (req, res, next) => { export const getInfo = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting Eclair Node Information..' }); logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting Eclair Node Information..' });

View File

@ -1,5 +1,4 @@
import request from 'request-promise'; import request from 'request-promise';
import { Database, DatabaseService } from '../../utils/database.js';
import { Logger, LoggerService } from '../../utils/logger.js'; import { Logger, LoggerService } from '../../utils/logger.js';
import { Common, CommonService } from '../../utils/common.js'; import { Common, CommonService } from '../../utils/common.js';
import { LNDWSClient, LNDWebSocketClient } from './webSocketClient.js'; import { LNDWSClient, LNDWebSocketClient } from './webSocketClient.js';
@ -8,7 +7,6 @@ let options = null;
const logger: LoggerService = Logger; const logger: LoggerService = Logger;
const common: CommonService = Common; const common: CommonService = Common;
const lndWsClient: LNDWebSocketClient = LNDWSClient; const lndWsClient: LNDWebSocketClient = LNDWSClient;
const databaseService: DatabaseService = Database;
export const getInfo = (req, res, next) => { export const getInfo = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting LND Node Information..' }); logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'GetInfo', msg: 'Getting LND Node Information..' });

View File

@ -32,7 +32,6 @@ export class ClipboardDirective {
try { try {
// Allowing deprecated command for older browsers where navigator is not available. // Allowing deprecated command for older browsers where navigator is not available.
// For newer browsers where execCommand is deprecated, navigator should be available and this fallback will not be called. // For newer browsers where execCommand is deprecated, navigator should be available and this fallback will not be called.
// eslint-disable-next-line deprecation/deprecation
const result = document.execCommand('copy'); const result = document.execCommand('copy');
if (result) { if (result) {
this.copied.emit(this.payload.toString()); this.copied.emit(this.payload.toString());