Skip to content

Commit

Permalink
Merge pull request #15130 from Budibase/update-eslint
Browse files Browse the repository at this point in the history
Update eslint
  • Loading branch information
samwho authored Dec 9, 2024
2 parents 3d8b415 + 41c1e80 commit b960b09
Show file tree
Hide file tree
Showing 34 changed files with 542 additions and 411 deletions.
13 changes: 0 additions & 13 deletions .eslintignore

This file was deleted.

129 changes: 0 additions & 129 deletions .eslintrc.json

This file was deleted.

176 changes: 176 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
import globals from "globals"
import babelParser from "@babel/eslint-parser"
import svelteParser from "svelte-eslint-parser"
import tsParser from "@typescript-eslint/parser"

import eslintPluginJest from "eslint-plugin-jest"
import eslintPluginSvelte from "eslint-plugin-svelte"
import eslintPluginLocalRules from "eslint-plugin-local-rules"

import eslint from "@eslint/js"
import tseslint from "typescript-eslint"

export default [
eslint.configs.recommended,
{
ignores: [
"**/node_modules",
"**/dist",
"**/public",
"**/*.spec.js",
"**/bundle.js",
"**/node_modules",
"**/public",
"**/dist",
"packages/server/builder",
"packages/server/coverage",
"packages/worker/coverage",
"packages/backend-core/coverage",
"packages/server/client",
"packages/server/coverage",
"packages/builder/.routify",
"packages/sdk/sdk",
"**/*.ivm.bundle.js",
"packages/server/build/oldClientVersions/**/**/*",
],
},
{
plugins: {
"local-rules": eslintPluginLocalRules,
},

languageOptions: {
globals: {
...globals.browser,
...globals.jest,
...globals.node,
GeolocationPositionError: true,
},

parser: babelParser,
ecmaVersion: 2019,
sourceType: "module",

parserOptions: {
allowImportExportEverywhere: true,
},
},

rules: {
"no-self-assign": "off",
"prefer-const": "off",
"no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
caughtErrors: "none",
},
],
},
},
...eslintPluginSvelte.configs["flat/recommended"].map(config => {
return {
...config,
files: ["**/*.svelte"],

languageOptions: {
parser: svelteParser,
ecmaVersion: 2019,
sourceType: "script",

parserOptions: {
parser: "@typescript-eslint/parser",
allowImportExportEverywhere: true,
},
},
}
}),
...tseslint.configs.recommended.map(config => {
return {
...config,
files: ["**/*.ts"],

languageOptions: {
globals: {
NodeJS: true,
},

parser: tsParser,
},

rules: {
"prefer-spread": "off",
"no-unused-vars": "off",
"prefer-rest-params": "off",
"local-rules/no-barrel-imports": "error",
"local-rules/no-budibase-imports": "error",
"local-rules/no-console-error": "error",

"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
caughtErrors: "none",
},
],

"no-redeclare": "off",
"@typescript-eslint/no-redeclare": "error",
"no-dupe-class-members": "off",
},
}
}),
{
files: ["**/*.spec.ts"],

plugins: {
jest: eslintPluginJest,
},

languageOptions: {
globals: {
...eslintPluginJest.environments.globals.globals,
NodeJS: true,
},

parser: tsParser,
},

rules: {
"local-rules/no-test-com": "error",
"local-rules/email-domain-example-com": "error",
"no-console": "warn",
"jest/expect-expect": "off",
"jest/no-conditional-expect": "off",
"no-dupe-class-members": "off",
"no-redeclare": "off",
},
},
{
files: [
"packages/builder/**/*",
"packages/client/**/*",
"packages/frontend-core/**/*",
],

rules: {
"no-console": [
"error",
{
allow: ["warn", "error", "debug"],
},
],
},
},
]
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@
"private": true,
"devDependencies": {
"@babel/core": "^7.22.5",
"@babel/eslint-parser": "^7.22.5",
"@babel/eslint-parser": "7.25.9",
"@babel/preset-env": "^7.22.5",
"@esbuild-plugins/tsconfig-paths": "^0.1.2",
"@types/node": "20.10.0",
"@types/proper-lockfile": "^4.1.4",
"@typescript-eslint/parser": "6.9.0",
"@typescript-eslint/parser": "8.17.0",
"cross-spawn": "7.0.6",
"depcheck": "^1.4.7",
"esbuild": "^0.18.17",
"esbuild-node-externals": "^1.14.0",
"eslint": "^8.52.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-local-rules": "^2.0.0",
"eslint-plugin-svelte": "^2.34.0",
"eslint": "9.16.0",
"eslint-plugin-jest": "28.9.0",
"eslint-plugin-local-rules": "3.0.2",
"eslint-plugin-svelte": "2.46.1",
"husky": "^8.0.3",
"kill-port": "^1.6.1",
"lerna": "7.4.2",
Expand All @@ -27,9 +26,9 @@
"prettier-plugin-svelte": "^2.3.0",
"proper-lockfile": "^4.1.2",
"svelte": "4.2.19",
"svelte-eslint-parser": "^0.33.1",
"svelte-eslint-parser": "0.43.0",
"typescript": "5.7.2",
"typescript-eslint": "^7.3.1",
"typescript-eslint": "8.17.0",
"yargs": "^17.7.2"
},
"scripts": {
Expand Down Expand Up @@ -115,7 +114,8 @@
"passport": "0.6.0",
"fast-xml-parser": "4.4.1",
"@azure/identity": "4.2.1",
"kind-of": "6.0.3"
"kind-of": "6.0.3",
"globals": "15.13.0"
},
"engines": {
"node": ">=20.0.0 <21.0.0"
Expand Down
2 changes: 0 additions & 2 deletions packages/backend-core/src/events/publishers/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import {
QueriesRunEvent,
} from "@budibase/types"

/* eslint-disable */

const created = async (
datasource: Datasource,
query: Query,
Expand Down
2 changes: 0 additions & 2 deletions packages/backend-core/src/events/publishers/rows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
Table,
} from "@budibase/types"

/* eslint-disable */

const created = async (count: number, timestamp?: string | number) => {
const properties: RowsCreatedEvent = {
count,
Expand Down
2 changes: 0 additions & 2 deletions packages/backend-core/src/events/publishers/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import {
ViewJoinCreatedEvent,
} from "@budibase/types"

/* eslint-disable */

async function created(view: ViewV2, timestamp?: string | number) {
const properties: ViewCreatedEvent = {
name: view.name,
Expand Down
Loading

0 comments on commit b960b09

Please sign in to comment.