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
167 changes: 0 additions & 167 deletions .eslintrc

This file was deleted.

171 changes: 171 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
import js from '@eslint/js';
import globals from 'globals';

export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
globals: {
...globals.node,
arguments: 'writable',
},
},

rules: {
'array-bracket-spacing': ['error', 'never'],
'brace-style': ['error', 'stroustrup', {
allowSingleLine: true,
}],
'camelcase': ['error', {
properties: 'never',
}],
'comma-spacing': ['error', {
before: false,
after: true,
}],
'comma-style': ['error', 'last'],
'comma-dangle': ['error', 'always-multiline'],
'complexity': ['warn', 8],
'computed-property-spacing': ['error', 'never'],
'consistent-return': 'warn',
'curly': ['error', 'all'],
'default-case': 'error',
'dot-notation': ['warn', {
allowKeywords: true,
}],
'dot-location': ['error', 'property'],
'eol-last': 'error',
'eqeqeq': 'error',
'func-call-spacing': ['error', 'never'],
'func-style': 'off',
'guard-for-in': 'off',
'indent': ['error', 2, {
SwitchCase: 1,
}],
'keyword-spacing': 'error',
'key-spacing': ['error', {
beforeColon: false,
afterColon: true,
}],
'lines-around-comment': ['error', {
beforeBlockComment: true,
afterBlockComment: true,
beforeLineComment: true,
afterLineComment: false,
allowBlockStart: true,
allowBlockEnd: false,
}],
'linebreak-style': ['error', 'unix'],
'max-nested-callbacks': ['warn', 3],
'new-cap': 'off',
'padding-line-between-statements': ['error', {
blankLine: 'always',
prev: ['var', 'let', 'const'],
next: '*',
}, {
blankLine: 'any',
prev: ['var', 'let', 'const'],
next: ['var', 'let', 'const'],
}],
'no-alert': 'error',
'no-caller': 'error',
'no-delete-var': 'error',
'no-div-regex': 'error',
'no-duplicate-case': 'error',
'no-else-return': 'error',
'no-empty': 'error',
'no-empty-character-class': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-semi': 'error',
'no-fallthrough': 'error',
'no-floating-decimal': 'error',
'no-func-assign': 'error',
'no-implied-eval': 'error',
'no-inline-comments': 'error',
'no-invalid-regexp': 'error',
'no-label-var': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-mixed-requires': 'off',
'no-mixed-spaces-and-tabs': 'error',
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-multiple-empty-lines': ['error', {
max: 2,
}],
'no-global-assign': 'error',
'no-nested-ternary': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-octal': 'error',
'no-path-concat': 'error',
'no-param-reassign': 'off',
'no-process-env': 'off',
'no-proto': 'error',
'no-redeclare': 'error',
'no-return-assign': ['error', 'always'],
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'warn',
'no-sync': 'warn',
'no-ternary': 'off',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-undefined': 'error',
'no-underscore-dangle': ['error', { allowAfterThis: true }],
'no-unexpected-multiline': 'error',
'no-unneeded-ternary': 'error',
'no-unreachable': 'error',
'no-unused-vars': 'warn',
'no-use-before-define': 'error',
'no-useless-concat': 'error',
'no-warning-comments': 'warn',
'no-with': 'error',
'object-curly-spacing': ['error', 'always', {
objectsInObjects: false,
arraysInObjects: false,
}],
'one-var': ['error', 'never'],
'operator-assignment': ['error', 'always'],
'operator-linebreak': ['error', 'before'],
'padded-blocks': 'off',
'quote-props': ['error', 'consistent'],
'quotes': ['error', 'single', 'avoid-escape'],
'radix': 'error',
'semi': 'error',
'semi-spacing': ['error', {
before: false,
after: true,
}],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'always',
}],
'space-in-parens': ['error', 'always'],
'space-infix-ops': 'error',
'space-unary-ops': ['error', {
words: true,
nonwords: false,
overrides: {
'!': true,
},
}],
'spaced-comment': ['error', 'always'],
'use-isnan': 'error',
'valid-typeof': 'error',
'vars-on-top': 'error',
'wrap-regex': 'off',
'yoda': ['error', 'never'],
},
},
];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {},
"devDependencies": {
"dotest": "^2.10.0"
"dotest": "^2"
},
"engines": {
"node": ">=18"
Expand Down
18 changes: 8 additions & 10 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


// ! Basic tests
dotest.add( 'Module', async test => {

Check warning on line 25 in test.js

View workflow job for this annotation

GitHub Actions / Node (24)

Async arrow function has a complexity of 15. Maximum allowed is 8

Check warning on line 25 in test.js

View workflow job for this annotation

GitHub Actions / Node (25)

Async arrow function has a complexity of 15. Maximum allowed is 8

Check warning on line 25 in test.js

View workflow job for this annotation

GitHub Actions / Node (24)

Async arrow function has a complexity of 15. Maximum allowed is 8

Check warning on line 25 in test.js

View workflow job for this annotation

GitHub Actions / Node (25)

Async arrow function has a complexity of 15. Maximum allowed is 8
test()
.isClass( 'fail', 'exports', app )
.isFunction( 'fail', '.getAllStations', ns && ns.getAllStations )
Expand Down Expand Up @@ -152,12 +152,11 @@
}
finally {
test( error )
.info( 'dateTime = Tomorrow 14:00' )
.info( dateTime.toString() )
.info( 'dateTime is proving impossible to test' )
.isArray( 'fail', 'data', data )
.isNotEmpty( 'fail', 'data', data )
.isObject( 'fail', 'data[0]', data && data[0] )
.isString( 'fail', 'data[0].actualDateTime', data && data[0] && data[0].actualDateTime )
.isNotEmpty( 'warn', 'data', data )
.isObject( 'warn', 'data[0]', data && data[0] )
.isString( 'warn', 'data[0].actualDateTime', data && data[0] && data[0].actualDateTime )
.done()
;
}
Expand All @@ -179,12 +178,11 @@
}
finally {
test( error )
.info( 'dateTime = Tomorrow 14:00' )
.info( dateTime.toString() )
.info( 'dateTime is proving impossible to test' )
.isArray( 'fail', 'data', data )
.isNotEmpty( 'fail', 'data', data )
.isObject( 'fail', 'data[0]', data && data[0] )
.isString( 'fail', 'data[0].actualDateTime', data && data[0] && data[0].actualDateTime )
.isNotEmpty( 'warn', 'data', data )
.isObject( 'warn', 'data[0]', data && data[0] )
.isString( 'warn', 'data[0].actualDateTime', data && data[0] && data[0].actualDateTime )
.done()
;
}
Expand Down
Loading