Skip to content
Merged
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
83 changes: 42 additions & 41 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
const globals = require('globals');
const pluginJs = require('@eslint/js');
const jsdoc = require('eslint-plugin-jsdoc');
const stylisticJs = require('@stylistic/eslint-plugin-js');
const stylistic = require('@stylistic/eslint-plugin');

module.exports = [
{
Expand All @@ -33,8 +33,7 @@ module.exports = [
pluginJs.configs.recommended,
{
plugins: {
jsdoc,
'@stylistic/js': stylisticJs,
'@stylistic': stylistic,
},
languageOptions: {
parserOptions: {
Expand Down Expand Up @@ -114,131 +113,133 @@ module.exports = [
'jsdoc/no-defaults': ['off'],
// 'jsdoc/tag-lines': ['error', 'any', { startLines: 1 }],
'jsdoc/tag-lines': ['off'], // TODO with above 0 or 1
'@stylistic/js/array-bracket-newline': [
'jsdoc/reject-any-type': ['off'], // TODO
'jsdoc/reject-function-type': ['off'], // TODO
'@stylistic/array-bracket-newline': [
'error',
{
multiline: true,
},
],
'@stylistic/js/array-bracket-spacing': [
'@stylistic/array-bracket-spacing': [
'error',
'never',
{
singleValue: false,
},
],
'@stylistic/js/array-element-newline': [
'@stylistic/array-element-newline': [
'error',
'consistent',
],
'@stylistic/js/arrow-parens': [
'@stylistic/arrow-parens': [
'error',
'always',
],
'@stylistic/js/brace-style': [
'@stylistic/brace-style': [
'error',
'1tbs',
{
allowSingleLine: false,
},
],
'@stylistic/js/comma-dangle': [
'@stylistic/comma-dangle': [
'error',
'always-multiline',
],
'@stylistic/js/comma-spacing': [
'@stylistic/comma-spacing': [
'error',
{
before: false,
after: true,
},
],
'@stylistic/js/comma-style': [
'@stylistic/comma-style': [
'error',
'last',
],
'@stylistic/js/computed-property-spacing': 'error',
'@stylistic/js/dot-location': [
'@stylistic/computed-property-spacing': 'error',
'@stylistic/dot-location': [
'error',
'property',
],
'@stylistic/js/eol-last': [
'@stylistic/eol-last': [
'error',
'always',
],
'@stylistic/js/function-call-argument-newline': [
'@stylistic/function-call-argument-newline': [
'error',
'consistent',
],
'@stylistic/js/function-paren-newline': [
'@stylistic/function-paren-newline': [
'error',
'multiline',
],
'@stylistic/js/indent': [
'@stylistic/indent': [
'error',
4,
{
SwitchCase: 1,
},
],
'@stylistic/js/key-spacing': 'error',
'@stylistic/js/keyword-spacing': 'error',
'@stylistic/js/linebreak-style': 'off',
'@stylistic/js/lines-around-comment': [
'@stylistic/key-spacing': 'error',
'@stylistic/keyword-spacing': 'error',
'@stylistic/linebreak-style': 'off',
'@stylistic/lines-around-comment': [
'error',
{
allowBlockStart: true,
allowClassStart: true,
beforeBlockComment: true,
},
],
'@stylistic/js/lines-between-class-members': [
'@stylistic/lines-between-class-members': [
'error',
'always',
],
'@stylistic/js/max-len': [
'@stylistic/max-len': [
'error',
{
code: 145,
},
],
'@stylistic/js/multiline-comment-style': [
'@stylistic/multiline-comment-style': [
'error',
'starred-block',
],
'@stylistic/js/no-extra-parens': [
'@stylistic/no-extra-parens': [
'error',
'all',
{
conditionalAssign: false,
ternaryOperandBinaryExpressions: false,
},
],
'@stylistic/js/no-multi-spaces': 'error',
'@stylistic/js/no-multiple-empty-lines': [
'@stylistic/no-multi-spaces': 'error',
'@stylistic/no-multiple-empty-lines': [
'error',
{
max: 1,
maxBOF: 0,
maxEOF: 0,
},
],
'@stylistic/js/no-trailing-spaces': 'error',
'@stylistic/js/object-curly-spacing': [
'@stylistic/no-trailing-spaces': 'error',
'@stylistic/object-curly-spacing': [
'error',
'always',
],
'@stylistic/js/object-property-newline': [
'@stylistic/object-property-newline': [
'error',
{
allowAllPropertiesOnSameLine: true,
},
],
'@stylistic/js/padded-blocks': [
'@stylistic/padded-blocks': [
'error',
'never',
],
'@stylistic/js/padding-line-between-statements': [
'@stylistic/padding-line-between-statements': [
'error',
{
blankLine: 'always',
Expand All @@ -256,44 +257,44 @@ module.exports = [
next: 'cjs-export',
},
],
'@stylistic/js/quote-props': [
'@stylistic/quote-props': [
'error',
'as-needed',
],
'@stylistic/js/quotes': [
'@stylistic/quotes': [
'error',
'single',
{
avoidEscape: true,
},
],
'@stylistic/js/semi': 'error',
'@stylistic/js/semi-style': [
'@stylistic/semi': 'error',
'@stylistic/semi-style': [
'error',
'last',
],
'@stylistic/js/space-before-blocks': [
'@stylistic/space-before-blocks': [
'error',
{
functions: 'always',
keywords: 'always',
classes: 'always',
},
],
'@stylistic/js/space-before-function-paren': [
'@stylistic/space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
},
],
'@stylistic/js/space-infix-ops': 'error',
'@stylistic/js/space-in-parens': [
'@stylistic/space-infix-ops': 'error',
'@stylistic/space-in-parens': [
'error',
'never',
],
'@stylistic/js/template-curly-spacing': [
'@stylistic/template-curly-spacing': [
'error',
'never',
],
Expand Down
2 changes: 1 addition & 1 deletion lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class BookkeepingApplication {
}

/**
* Housekeeping method, it wraps @see handleLostRunsAndEnvironments and logs its results
* Housekeeping method, it wraps {@see handleLostRunsAndEnvironments} and logs its results
*
* @param {Agent} httpAgent agent to be used by the HTTP client
* @return {Promise<void>} promise
Expand Down
2 changes: 1 addition & 1 deletion lib/database/DataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DataSource {
/**
* Execute a given code in an auto-handled transaction. This will handle committing or rolling back the transaction automatically.
*
* @param {function} wrapped the function to wrap in a transaction
* @param {Function} wrapped the function to wrap in a transaction
* @param {Object} [options] eventual options of the transaction
* @param {Transaction} [options.transaction] if specified, the wrapped function will be executed in this transaction
* @returns {Promise} Return of the callback
Expand Down
2 changes: 1 addition & 1 deletion lib/database/migrations/v0/20200505214213-create-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = {
type: Sequelize.CHAR,
},
detectors: {
// eslint-disable-next-line @stylistic/js/max-len
// eslint-disable-next-line @stylistic/max-len
type: Sequelize.ENUM('CPV', 'EMC', 'FDD', 'FT0', 'FV0', 'HMP', 'ITS', 'MCH', 'MFT', 'MID', 'PHS', 'TOF', 'TPC', 'TRD', 'TST', 'ZDC'),
},
created_at: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
queryInterface.sequelize.transaction((transaction) =>
Promise.all([
queryInterface.changeColumn('runs', 'detectors', {
// eslint-disable-next-line @stylistic/js/max-len
// eslint-disable-next-line @stylistic/max-len
type: Sequelize.ENUM('CPV', 'EMC', 'FDD', 'FT0', 'FV0', 'HMP', 'ITS', 'MCH', 'MFT', 'MID', 'PHS', 'TOF', 'TPC', 'TRD', 'TST', 'ZDC'),
}, { transaction }),
])),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ const _updateEffectivePeriodForScopeAndPeriod = async (
{ runNumber, dplDetectorId, dataPassId, simulationPassId, createdAt },
{ transaction },
) => {
let joinClause =
`
let joinClause = `
INNER JOIN quality_control_flags as qcf
ON qcfep.flag_id = qcf.id
AND qcf.run_number = ${runNumber}
Expand Down
2 changes: 1 addition & 1 deletion lib/database/utilities/QueryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ class QueryBuilder {
/**
* Add a condition to the currently building where clauses using AND operation
*
* @param {string|function|Object} subject the subject on which where condition must be applied or the full criteria expression
* @param {string|Function|Object} subject the subject on which where condition must be applied or the full criteria expression
* @param {Object|undefined} [criteria] the criteria of the where condition. If undefined, the subject is expected to contain the full
* criteria
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import { ObservableBasedSelectionDropdownModel } from '../../detector/Observable
* Return the option value corresponding to a given magnets current level
*
* @param {MagnetsCurrentLevels} currentLevels the current levels
* @return {object<value: string>} the option's value
* @return {{value: string}} the option's value
*/
const magnetsCurrentLevelsToKey = ({ l3, dipole }) => ({ value: `${l3}kA/${dipole}kA` });

/**
* Return the magnets current lever based on a key string
*
* @param {object} value string containing the current levels
* @return {MagnetsCurrentLevels}
* @return {MagnetsCurrentLevels} the magnets current levels
*/
const keyToMagnetsCurrentLevels = (value) => {
const [l3, dipole] = value.split('/').map((str) => parseFloat(str.slice(0, -2)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ export class MultiCompositionFilterModel extends FilterModel {
}

/**
* Return a subfilter by key
* Add new subfilter
*
* @param {string} key the key of the subfilter
* @return {FilterModel} the subfilter
* @param {string} key key of the subfilter
* @param {FilterModel} filterModel the subfilter
* @return {void}
*/
putFilter(key, filterModel) {
if (key in this._filters) {
Expand All @@ -48,10 +49,10 @@ export class MultiCompositionFilterModel extends FilterModel {
}

/**
* Add new subfilter
* Return a subfilter by key
*
* @param {string} key key of the subfilter
* @param {FilterModel} filter the the subfilter
* @param {string} key the key of the subfilter
* @return {FilterModel} the subfilter
*/
getFilter(key) {
if (!(key in this._filters)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/public/components/Filters/common/FilteringModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class FilteringModel extends Observable {
/**
* Sets all filters using their normalized setters
*
* @param {object<string, object|string} filters an object containing normalized filter values
* @param {object<string, object|string>} filters an object containing normalized filter values
* @returns {object<string, string[]>} an object containging the uknown filters and the filters that failed to parse
*/
_setFilters(filters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class RadioButtonFilterModel extends SelectionModel {
* Constructor
*
* @param {SelectionOption[]} [availableOptions] the list of possible operators
* @param {function} [setDefault] function that selects the default from the list of available options. Selects first entry by default
* @param {Function} [setDefault] function that selects the default from the list of available options. Selects first entry by default
* @param {boolean} [defaultIsEmpty] if true, the default selection will be treated as empty
*/
constructor(availableOptions, setDefault = (options) => [options[0]], defaultIsEmpty = true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ export class ProcessedTextInputModel extends Observable {
/**
* Sets filters from normalised values.
*
* @param {string} value The value used to set the parsed value
* @param {string} raw The value used to set the raw value
* @param {object} normalized the normalized values
* @param {string} normalized.value The value used to set the parsed value
* @param {string} normalized.raw The value used to set the raw value
* @return {void}
* @abstract
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { RawTextFilterModel } from './RawTextFilterModel.js';
const TOKENS_DELIMITER = ',';

/**
* Model which accept string input and treats it as sequence of tokens, which processed in regard to given configuration. @see
* TextTokensFilterModel#constructor
* Model which accept string input and treats it as sequence of tokens, which processed in regard to given configuration. {@see
* TextTokensFilterModel#constructor}
*/
export class TextTokensFilterModel extends RawTextFilterModel {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class ToggleFilterModel extends SelectionModel {
/**
* Returns if the toggle filter is considered 'inactive'
*
* @return {boolean}
* @return {boolean} true if the filter is inactive
*/
get isInactive() {
if (this._defaultIsInactive) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { rawTextFilter } from './rawTextFilter.js';
* @param {FilteringModel} filteringModel the page's filteringModel
* @param {string} key the identifier to serve as css selector and to fetch the correct filter from the filteringModel
* @param {string} placeholder placeholder text for the input element
* @param {string} width class that determines the width of the input
* @param {string} [widthClass='w-100'] class that determines the width of the input
* @return {Component} the filter
*/
export const textInputFilter = (filteringModel, key, placeholder, widthClass = 'w-100') =>
Expand Down
Loading
Loading