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

Bump eslint from 8.56.0 to 9.7.0 in /Control #2479

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions Control/config-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ module.exports = {
// key: './cert/key.pem',
// cert: './cert/cert.pem',
tls: false,
limit: '1Mb'
limit: '1Mb',
},
grpc: {
hostname: 'localhost',
port: 9090,
timeout: 20000, // ms, gRPC deadline for service calls
maxMessageLength: 50, // MB, gRPC receive message limit
label: 'Control',
package: 'o2control'
package: 'o2control',
},
apricot: {
hostname: 'localhost',
port: 9090,
timeout: 20000, // ms, gRPC deadline for service calls
maxMessageLength: 50, // MB, gRPC receive message limit
label: 'Apricot',
package: 'apricot'
package: 'apricot',
},
grafana: {
url: 'http://localhost:3000'
url: 'http://localhost:3000',
},
bookkeeping: {
url: 'http://localhost:4000',
Expand All @@ -51,7 +51,7 @@ module.exports = {
url: 'localhost:8083',
},
qcGui: {
url: 'qcg.cern.ch'
url: 'qcg.cern.ch',
},
utils: {
refreshTask: 10000, // how often should task list page should refresh its content
Expand Down
260 changes: 260 additions & 0 deletions Control/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
/**
* @license
* Copyright 2019-2020 CERN and copyright holders of ALICE O2.
* See http://alice-o2.web.cern.ch/copyright for details of the copyright holders.
* All rights not expressly granted are reserved.
*
* This software is distributed under the terms of the GNU General Public
* License v3 (GPL Version 3), copied verbatim in the file "COPYING".
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

const globals = require('globals');
const pluginJs = require('@eslint/js');
const jsdoc = require('eslint-plugin-jsdoc');
const stylisticJs = require('@stylistic/eslint-plugin-js');

module.exports = [
jsdoc.configs['flat/recommended'],
pluginJs.configs.recommended,
{
plugins: {
jsdoc,
'@stylistic/js': stylisticJs,
},
languageOptions: {
parserOptions: {
sourceType: 'module',
},
globals: {
...globals.browser,
...globals.node,
...globals.mocha,
process: 'readonly',
Model: 'readonly',
vnode: 'readonly',
Express: 'readonly',
setImmediate: 'readonly',
},
},
rules: {
'arrow-body-style': ['error', 'as-needed'],
curly: 'error',
indent: [
'error',
2,
{
SwitchCase: 1,
},
],
'init-declarations': ['error', 'always'],
'no-console': 'error',
'no-implicit-coercion': 'error',
'no-return-assign': 'error',
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^(_|((request|response|next)$))',
},
],
'no-var': 'error',
'one-var': [
'error',
'never',
],
'prefer-arrow-callback': [
'error',
{
allowUnboundThis: true,
},
],
'prefer-const': 'error',
'prefer-destructuring': 'error',
'prefer-object-spread': 'error',
'prefer-template': 'error',
radix: 'error',
'jsdoc/require-description': ['error'],
'jsdoc/check-values': ['off'],
'jsdoc/no-multi-asterisks': ['off'],
'jsdoc/no-undefined-types': ['off'],
'jsdoc/check-tag-names': ['warn', { definedTags: ['rejects'] }],
'jsdoc/no-defaults': ['off'],
'@stylistic/js/array-bracket-newline': [
'error',
{
multiline: true,
},
],
'@stylistic/js/array-bracket-spacing': [
'error',
'never',
{
singleValue: false,
},
],
'@stylistic/js/array-element-newline': [
'error',
'consistent',
],
'@stylistic/js/arrow-parens': [
'error',
'always',
],
'@stylistic/js/brace-style': [
'error',
'1tbs',
{
allowSingleLine: false,
},
],
'@stylistic/js/comma-dangle': [
'error',
'always-multiline',
],
'@stylistic/js/comma-spacing': [
'error',
{
before: false,
after: true,
},
],
'@stylistic/js/comma-style': [
'error',
'last',
],
'@stylistic/js/computed-property-spacing': 'error',
'@stylistic/js/dot-location': [
'error',
'property',
],
'@stylistic/js/eol-last': [
'error',
'always',
],
'@stylistic/js/function-call-argument-newline': [
'error',
'consistent',
],
'@stylistic/js/function-paren-newline': [
'error',
'multiline',
],
'@stylistic/js/indent': [
'error',
2,
{
SwitchCase: 1,
},
],
'@stylistic/js/key-spacing': 'error',
'@stylistic/js/keyword-spacing': 'error',
'@stylistic/js/linebreak-style': 'off',
'@stylistic/js/lines-around-comment': [
'error',
{
allowBlockStart: true,
allowClassStart: true,
beforeBlockComment: true,
},
],
'@stylistic/js/lines-between-class-members': [
'error',
'always',
],
'@stylistic/js/max-len': [
'error',
{
code: 120,
},
],
'@stylistic/js/no-extra-parens': 'error',
'@stylistic/js/no-multi-spaces': 'error',
'@stylistic/js/no-multiple-empty-lines': [
'error',
{
max: 1,
maxBOF: 0,
maxEOF: 0,
},
],
'@stylistic/js/no-trailing-spaces': 'error',
'@stylistic/js/object-curly-spacing': [
'error',
'always',
],
'@stylistic/js/object-property-newline': [
'error',
{
allowAllPropertiesOnSameLine: true,
},
],
'@stylistic/js/padded-blocks': [
'error',
'never',
],
'@stylistic/js/padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: 'cjs-import',
next: '*',
},
{
blankLine: 'any',
prev: 'cjs-import',
next: 'cjs-import',
},
{
blankLine: 'always',
prev: '*',
next: 'cjs-export',
},
],
'@stylistic/js/quote-props': [
'error',
'as-needed',
],
'@stylistic/js/quotes': [
'error',
'single',
{
avoidEscape: true,
},
],
'@stylistic/js/semi': 'error',
'@stylistic/js/semi-style': [
'error',
'last',
],
'@stylistic/js/space-before-blocks': [
'error',
{
functions: 'always',
keywords: 'always',
classes: 'always',
},
],
'@stylistic/js/space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
},
],
'@stylistic/js/space-infix-ops': 'error',
'@stylistic/js/space-in-parens': [
'error',
'never',
],
'@stylistic/js/template-curly-spacing': [
'error',
'never',
],
'no-magic-numbers': 'off', // TODO: enable
},
},
];
8 changes: 4 additions & 4 deletions Control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/
*/

const path = require('path');
const {HttpServer, WebSocket} = require('@aliceo2/web-ui');
const { HttpServer, WebSocket } = require('@aliceo2/web-ui');

const config = require('./lib/config/configProvider.js');
const {buildPublicConfig} = require('./lib/config/publicConfigProvider.js');
const { buildPublicConfig } = require('./lib/config/publicConfigProvider.js');
const api = require('./lib/api.js');

// -------------------------------------------------------

buildPublicConfig(config);

config.http.iframeCsp = (config?.grafana?.url) ? [ config.grafana.url ] : [];
config.http.iframeCsp = config?.grafana?.url ? [config.grafana.url] : [];
const http = new HttpServer(config.http, config.jwt, config.openId);
const ws = new WebSocket(http);
http.addStaticPath(path.join(__dirname, 'public'));
Expand Down
Loading