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
19 changes: 0 additions & 19 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ export default [
]
},

// TODO(eslint-v9-follow-up): the ESLint 8 -> 9 / neostandard rule-set change left a number
// of now-stale inline `eslint-disable` comments in the codebase (for n/no-process-exit,
// n/no-extraneous-import, n/no-unpublished-require, n/handle-callback-err, no-unused-vars,
// no-useless-return, no-template-curly-in-string, promise/no-callback-in-promise,
// vue/one-component-per-file, etc.). They surface as "Unused eslint-disable directive"
// warnings. Silencing the report here to keep this migration PR small; remove this block
// and delete the stale directives in the follow-up PR.
{
linterOptions: {
reportUnusedDisableDirectives: 'off'
}
},

// extends: standard, plugin:import/recommended, plugin:promise/recommended, plugin:n/recommended
// neostandard is the flat-config successor to eslint-config-standard and registers
// (globally) the n and promise plugins plus @stylistic, subsuming the old promise/n
Expand Down Expand Up @@ -156,12 +143,6 @@ export default [
'vue/singleline-html-element-content-newline': 'off',
'vue/component-definition-name-casing': 'off',

// TODO(eslint-v9-follow-up): vue/no-required-prop-with-default is new in
// eslint-plugin-vue v10 and flags a required prop that also declares a default.
// Disabled to keep this migration PR small; fix the offending prop(s) and remove
// this in the follow-up PR.
'vue/no-required-prop-with-default': 'off',

// plugin:promise
'promise/always-return': 'off', // common Vue.js pattern

Expand Down
2 changes: 1 addition & 1 deletion forge/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
/* eslint-disable n/no-process-exit */

'use strict'

const semver = require('semver')
Expand Down
2 changes: 1 addition & 1 deletion forge/caches/redis-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function initCache (options, app) {
}
}
client = createClient(newOptions)
// eslint-disable-next-line n/handle-callback-err

client.on('error', (err) => {
app.log.info(`Valkey Cache error ${err}`)
})
Expand Down
2 changes: 1 addition & 1 deletion forge/containers/stub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
const { normalize } = require('path')

const nrUtil = require('@node-red/util') // eslint-disable-line
const nrUtil = require('@node-red/util')

const forgeUtils = require('../../db/utils')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-unused-vars */

/**
* Add ProjectSnapshots table
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-unused-vars */

/**
* Add ProjectSnapshots table
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-unused-vars */

/**
* Add editorAffinity details to Devices table
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-unused-vars */

/**
* Add credentialSecret to Snapshots table
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-unused-vars */
/**
* This migration ensures that all EE tables exist in the correct state.
* This is only relevant for users running OSS version who installed <2.1.0.
Expand Down
2 changes: 1 addition & 1 deletion forge/ee/routes/catalogues/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = async function (app) {
await request.team.ensureTeamTypeExists()
if (!request.team.getFeatureProperty('npm', false)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
}
if (!request.teamMembership && request.session.User) {
Expand Down
2 changes: 1 addition & 1 deletion forge/ee/routes/customHostnames/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = async function (app) {
await request.project.Team.ensureTeamTypeExists()
if (!request.project.Team.getFeatureProperty('customHostnames', true)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
if (request.session.User) {
request.teamMembership = await request.session.User.getTeamMembership(request.project.Team.id)
Expand Down
2 changes: 1 addition & 1 deletion forge/ee/routes/deviceEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = async function (app) {
// to return a redirect for this auth fail rather than an API error
if (!request.routeOptions.config.allowAnonymous && !request.teamMembership && !request.session.User.admin) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
if (request.device.ApplicationId) {
request.applicationId = app.db.models.Application.encodeHashid(request.device.ApplicationId)
Expand Down
2 changes: 1 addition & 1 deletion forge/ee/routes/gitops/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = async function (app) {
await request.team.ensureTeamTypeExists()
if (!request.team.getFeatureProperty('gitIntegration', false)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
if (!request.teamMembership) {
request.teamMembership = await request.session.User.getTeamMembership(request.team.id)
Expand Down
2 changes: 1 addition & 1 deletion forge/ee/routes/ha/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = async function (app) {
await request.project.Team.ensureTeamTypeExists()
if (!request.project.Team.getFeatureProperty('ha', true)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
if (request.session.User) {
request.teamMembership = await request.session.User.getTeamMembership(request.project.Team.id)
Expand Down
8 changes: 4 additions & 4 deletions forge/ee/routes/httpTokens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ module.exports = async function (app) {
await request.project.Team.ensureTeamTypeExists()
if (!request.project.Team.getFeatureProperty('teamHttpSecurity', false)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
if (request.session.User) {
request.teamMembership = await request.session.User.getTeamMembership(request.project.Team.id)
if (!request.teamMembership && !request.session.User.admin) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
} else if (request.session.ownerId !== request.params.projectId) {
// AccessToken being used - but not owned by this project
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
} catch (err) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
Expand All @@ -49,7 +49,7 @@ module.exports = async function (app) {
await request.device.Team.ensureTeamTypeExists()
if (!request.device.Team.getFeatureProperty('teamHttpSecurity', false)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
if (request.session.User) {
request.teamMembership = await request.session.User.getTeamMembership(request.device.Team.id)
Expand Down
2 changes: 1 addition & 1 deletion forge/ee/routes/protectedInstance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = async function (app) {
await request.project.Team.ensureTeamTypeExists()
if (!request.project.Team.getFeatureProperty('protectedInstance', true)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
if (request.session.User) {
request.teamMembership = await request.session.User.getTeamMembership(request.project.Team.id)
Expand Down
2 changes: 1 addition & 1 deletion forge/ee/routes/staticAssets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = async function (app) {
await request.project.Team.ensureTeamTypeExists()
if (!request.project.Team.getFeatureProperty('staticAssets', false)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found - not available on team' })
return // eslint-disable-line no-useless-return
return
}
if (request.session.User) {
request.teamMembership = await request.session.User.getTeamMembership(request.project.Team.id)
Expand Down
2 changes: 1 addition & 1 deletion forge/ee/routes/tables/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = async function (app) {
await request.team.ensureTeamTypeExists()
if (!request.team.getFeatureProperty('tables', false)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found - not available on team' })
return // eslint-disable-line no-useless-return
return
}
}
if (!request.teamMembership && request.session?.User) {
Expand Down
4 changes: 2 additions & 2 deletions forge/ee/routes/teamBroker/3rdPartyBroker.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ module.exports = async function (app) {
await request.team.ensureTeamTypeExists()
if (!request.team.getFeatureProperty('teamBroker', false)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
}

if (request.params.brokerId && request.params.brokerId !== 'team-broker') {
request.broker = await app.db.models.BrokerCredentials.byId(request.params.brokerId)
if (!request.broker) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion forge/ee/routes/teamBroker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = async function (app) {
await request.team.ensureTeamTypeExists()
if (!request.team.getFeatureProperty('teamBroker', false)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions forge/ee/routes/teamBroker/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ module.exports = async function (app) {
await request.team.ensureTeamTypeExists()
if (!request.team.getFeatureProperty('teamBroker', false)) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
}

if (request.params.brokerId && request.params.brokerId !== 'team-broker') {
request.broker = await app.db.models.BrokerCredentials.byId(request.params.brokerId)
if (!request.broker) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions forge/forge.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fastify = require('fastify')
const auditLog = require('./auditLog')
const caches = require('./caches')
const comms = require('./comms')
const config = require('./config') // eslint-disable-line n/no-unpublished-require
const config = require('./config')
const containers = require('./containers')
const db = require('./db')
const ee = require('./ee')
Expand Down Expand Up @@ -182,7 +182,7 @@ module.exports = async (options = {}) => {
// Test Only. Permit access to app.routes - for evaluating routes in tests
if (options.config?.test?.fastifyRoutes) {
// since @fastify/routes is a dev dependency, we only load it when requested in test
server.register(require('@fastify/routes')) // eslint-disable-line n/no-unpublished-require
server.register(require('@fastify/routes'))
}

// Rate Limits: rate limiting for the server end points
Expand Down
2 changes: 1 addition & 1 deletion forge/routes/api/deviceSnapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = async function (app) {
request.snapshot = await app.db.models.ProjectSnapshot.byId(request.params.snapshotId)
if (!request.snapshot || request.snapshot.DeviceId !== request.device.id) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
return // eslint-disable-line no-useless-return
return
}
} catch (err) {
reply.code(404).send({ code: 'not_found', error: 'Not Found' })
Expand Down
1 change: 0 additions & 1 deletion forge/routes/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@ async function init (app, opts) {
*/
app.post('/account/verify', {
preHandler: function (request, reply, done) {
// eslint-disable-next-line promise/no-callback-in-promise
app.verifySession(request, reply).then(() => done()).catch(done)
},
config: {
Expand Down
3 changes: 1 addition & 2 deletions forge/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = fp(async function (app, opts) {

// Response Validation: dev only — surfaces schema/view drift as 500s.
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line n/no-unpublished-require -- dev-only, gated above
const Ajv = require('ajv')
const ajv = new Ajv({
coerceTypes: false,
Expand Down Expand Up @@ -71,7 +70,7 @@ module.exports = fp(async function (app, opts) {
}
}
})
// eslint-disable-next-line n/no-unpublished-require -- dev-only, gated above

await app.register(require('@fastify/response-validation'), { ajv })
}

Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/audit-log/AuditLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
</template>

<script>
/* eslint-disable no-template-curly-in-string */

import FFAccordion from '../Accordion.vue'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export default {
props: {
state: {
required: true,
type: [String, null, undefined],
default: null
type: [String, null, undefined]
},
pendingStateChange: {
required: false,
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/multi-step-forms/MultiStepForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export default {
props: {
steps: {
type: Array,
required: true,
default: () => []
required: true
},
startingStep: {
type: Number,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/composables/Hubspot.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function useHubspotHelper () {
confirmLabel: 'Close',
canBeCanceled: false,
is: {
// eslint-disable-next-line vue/one-component-per-file

component: defineComponent({
computed: {
url () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default {
},
reloadHooks: {
type: Array,
required: true,
required: false,
default: () => []
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export default {
props: {
application: {
type: Object,
required: true,
default: null
required: true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export default {
props: {
application: {
type: Object,
required: true,
default: null
required: true
}
},
setup () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export default {
props: {
application: {
type: Object,
required: true,
default: null
required: true
}
},
setup () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export default {
// TODO: should the create allow a device to be created
// in the project directly? Currently done as a two
// step process
// eslint-disable-next-line promise/no-nesting

return devicesApi.updateDevice(response.id, { instance: this.instance.id }).then((response) => {
// Reattach the credentials from the create request
// so they can be displayed to the user
Expand All @@ -236,7 +236,7 @@ export default {
const creds = response.credentials
// TODO: should the create allow a device to linked to an application at the same time?
// currently, as above, this is a 2 step process
// eslint-disable-next-line promise/no-nesting

return devicesApi.updateDevice(response.id, { application }).then((response) => {
// Reattach the credentials from the create request
// so they can be displayed to the user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default defineComponent({
type: Array
},
collapsed: {
required: true,
required: false,
type: Boolean,
default: true
},
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/team/changeType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ import { useAccountSettingsStore } from '@/stores/account-settings.js'
import { useAccountStore } from '@/stores/account.js'
import { useContextStore } from '@/stores/context.js'

// eslint-disable-next-line vue/one-component-per-file
export default {
name: 'ChangeTeamType',
components: {
Expand Down
Loading
Loading