Skip to content
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
71 changes: 0 additions & 71 deletions .eslintrc.cjs

This file was deleted.

37 changes: 22 additions & 15 deletions eslintrc-dist.cjs → dist.eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) NIWA & British Crown (Met Office) & Contributors.
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -15,22 +15,29 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/**
/*
* Eslint config for dist directory.
*
* Note: we can't keep it in there because it would get wiped by build.
*/
module.exports = {
plugins: ['compat'],
extends: ['plugin:compat/recommended'],
env: {
browser: true,
},
parserOptions: {
sourceType: 'module',
// Don't need to worry about ECMA syntax as that's handled by Vite/ESBuild
ecmaVersion: 'latest',

import { defineConfig } from 'eslint/config'
import globals from 'globals'
import compatPlugin from 'eslint-plugin-compat'

export default defineConfig([
compatPlugin.configs['flat/recommended'],
{
linterOptions: {
noInlineConfig: true,
},
languageOptions: {
sourceType: 'module',
globals: {
...globals.browser,
},
// Don't need to worry about ECMA syntax as that's handled by Vite/ESBuild:
ecmaVersion: 'latest',
},
},
noInlineConfig: true,
reportUnusedDisableDirectives: false, // doesn't seem to work
}
])
123 changes: 123 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/*
* Copyright (C) NIWA & British Crown (Met Office) & Contributors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { defineConfig } from 'eslint/config'
import js from '@eslint/js'
import globals from 'globals'
import pluginVue from 'eslint-plugin-vue'
import pluginVuetify from 'eslint-plugin-vuetify'
import pluginCypress from 'eslint-plugin-cypress/flat'
import noOnlyTests from 'eslint-plugin-no-only-tests'
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard'

const cypressTestFiles = ['tests/e2e/**', 'tests/component/**']
const unitTestFiles = ['**/*.spec.js']

export default defineConfig([
// NOTE: neostandard includes various plugins
...neostandard({
noJsx: true,
// Neostandard makes it easier to configure ignores than ESLint's way:
ignores: [
...resolveIgnoresFromGitignore(),
'.yarn/',
],
}),

js.configs.recommended,

...pluginVue.configs['flat/essential'],

...pluginVuetify.configs['flat/base'],

{
languageOptions: {
sourceType: 'module',
// Allow new ECMAScript syntax but not globals. This is because vite/esbuild
// transforms syntax to es2015 (at the earliest) but does not pollyfill APIs.
ecmaVersion: 'latest',
globals: {
...globals.browser,
}
},
rules: {
'@stylistic/comma-dangle': ['error', {
arrays: 'only-multiline',
objects: 'only-multiline',
imports: 'only-multiline',
exports: 'only-multiline',
functions: 'only-multiline',
}],

'no-console': ['error', {
allow: ['warn', 'error'],
}],

'vue/multi-word-component-names': ['off'],

'promise/param-names': ['error'],
'promise/no-return-wrap': ['error'],
},
},

{
files: ['scripts/**', 'src/services/mock/**'],
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
'no-console': ['off'],
},
},

{
files: cypressTestFiles,
plugins: {
cypress: pluginCypress,
},
extends: ['cypress/recommended'],
Comment on lines +91 to +94
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found eslint/eslint#19116 more illuminating than anything in the ESLint docs!

rules: {
'cypress/unsafe-to-chain-command': ['off'],
}
},

{
files: unitTestFiles,
languageOptions: {
globals: {
...globals.vitest,
},
},
},

{
files: [...unitTestFiles, ...cypressTestFiles],
plugins: {
'no-only-tests': noOnlyTests,
},
rules: {
'no-console': ['off'],

'no-only-tests/no-only-tests': ['error'],

// Don't complain about certain chai assertions:
'no-unused-expressions': ['off'],
},
},
])
23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"coverage:component": "COVERAGE=true yarn run test:component",
"coverage:e2e": "COVERAGE=true yarn run test:e2e",
"dev": "yarn run serve",
"lint": "eslint . --ext .js,.jsx,.mjs,.cjs,.ts,.tsx,.vue --ignore-path .gitignore",
"lint:compat": "eslint dist/ --no-eslintrc -c eslintrc-dist.cjs",
"lint": "eslint",
"lint:compat": "eslint dist/ -c dist.eslint.config.mjs",
"preview": "node ./scripts/concurrently.cjs serve:jupyterhub preview",
"serve": "node ./scripts/concurrently.cjs serve:jupyterhub serve:vue",
"serve:vue": "vite --mode offline",
Expand Down Expand Up @@ -55,38 +55,37 @@
},
"devDependencies": {
"@cypress/code-coverage": "3.14.1",
"@eslint/js": "9.24.0",
"@vitejs/plugin-vue": "5.2.4",
"@vitest/coverage-istanbul": "3.1.3",
"@vue/test-utils": "2.4.6",
"concurrently": "9.1.2",
"cross-fetch": "4.1.0",
"cypress": "14.3.3",
"cypress-vite": "1.6.0",
"eslint": "8.57.1",
"eslint-config-standard": "17.1.0",
"eslint-plugin-compat": "4.2.0",
"eslint-plugin-cypress": "2.15.2",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-n": "16.6.2",
"eslint": "9.24.0",
"eslint-plugin-compat": "6.0.2",
"eslint-plugin-cypress": "4.2.0",
"eslint-plugin-no-only-tests": "3.3.0",
"eslint-plugin-promise": "6.6.0",
"eslint-plugin-vue": "9.33.0",
"eslint-plugin-vue": "10.0.0",
"eslint-plugin-vuetify": "2.5.2",
"express": "5.1.0",
"express-ws": "5.0.2",
"globals": "16.0.0",
"istanbul-lib-coverage": "3.2.2",
"jsdom": "26.1.0",
"json-server": "0.17.4",
"neostandard": "0.12.1",
"nodemon": "3.1.10",
"nyc": "17.1.0",
"sass-embedded": "1.87.0",
"sinon": "20.0.0",
"standard": "17.1.2",
"vite": "6.3.5",
"vite-plugin-eslint": "1.8.1",
"vite-plugin-istanbul": "7.0.0",
"vite-plugin-vuetify": "2.1.1",
"vitest": "3.1.3"
"vitest": "3.1.3",
"vue-eslint-parser": "10.1.3"
},
"peerDependenciesMeta": {
"react": {
Expand Down
4 changes: 2 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
{
"groupName": "eslint packages",
"matchPackageNames": [
"standard",
"eslint*"
"/^@?eslint/",
"*-eslint-parser"
],
"automerge": true,
"schedule": [
Expand Down
1 change: 0 additions & 1 deletion scripts/concurrently.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
const concurrently = require('concurrently')

const args = process.argv.slice(2)
Expand Down
2 changes: 1 addition & 1 deletion src/components/cylc/tree/GScanTreeItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default {
computed: {
workflowLink () {
return this.node.type === 'workflow'
? `/workspace/${ this.node.tokens.workflow }`
? `/workspace/${this.node.tokens.workflow}`
: ''
},

Expand Down
2 changes: 1 addition & 1 deletion src/components/graphqlFormGenerator/FormInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default {
// dictionary of props for overriding default values
propOverrides: {
type: Object,
default: () => { Object() }
default: () => ({ })
}
},

Expand Down
5 changes: 0 additions & 5 deletions src/services/mock/.eslintrc.cjs

This file was deleted.

38 changes: 0 additions & 38 deletions tests/.eslintrc.cjs

This file was deleted.

Loading