Skip to content

Commit df8b9f6

Browse files
Julusiannytamin
authored andcommitted
chore: update code-preset and configs
1 parent f3d84af commit df8b9f6

File tree

91 files changed

+1371
-2203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1371
-2203
lines changed

.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
yarn lint-staged
1+
lint-staged

meteor/.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

meteor/.eslintrc.js

Lines changed: 0 additions & 107 deletions
This file was deleted.

meteor/eslint.config.mjs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { generateEslintConfig } from '@sofie-automation/code-standard-preset/eslint/main.mjs'
2+
3+
const tmpRules = {
4+
// Temporary rules to be removed over time
5+
'@typescript-eslint/ban-types': 'off',
6+
'@typescript-eslint/no-namespace': 'off',
7+
'@typescript-eslint/no-var-requires': 'off',
8+
'@typescript-eslint/no-non-null-assertion': 'off',
9+
'@typescript-eslint/unbound-method': 'off',
10+
'@typescript-eslint/no-misused-promises': 'off',
11+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
12+
'@typescript-eslint/no-require-imports': 'off',
13+
}
14+
15+
const extendedRules = await generateEslintConfig({
16+
// tsconfigName: 'tsconfig.eslint.json',
17+
ignores: ['.meteor', 'public', 'scripts', 'server/_force_restart.js', '/packages/'],
18+
19+
// disableNodeRules: true,
20+
})
21+
extendedRules.push({
22+
files: ['**/*'],
23+
rules: {
24+
// custom
25+
'no-inner-declarations': 'off', // some functions are unexported and placed inside a namespace next to related ones
26+
27+
'n/no-extraneous-import': 'off', // because there are a lot of them as dev-dependencies
28+
'n/no-missing-import': 'off', // erroring on every single import
29+
'react/prop-types': 'off', // we don't use this
30+
'@typescript-eslint/no-empty-interface': 'off', // many prop/state types are {}
31+
'@typescript-eslint/promise-function-async': 'off', // event handlers can't be async
32+
33+
'n/file-extension-in-import': ['error', 'never'], // Meteor breaks on importing ts files with a js extension
34+
35+
...tmpRules,
36+
},
37+
})
38+
39+
export default extendedRules

meteor/package.json

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"cov": "yarn unitcov && yarn cov-open",
2323
"license-validate": "node ../scripts/checkLicenses.js --allowed=\"MIT,BSD,ISC,Apache,Unlicense,CC0,LGPL,CC BY 3.0,CC BY 4.0,MPL 2.0,Python 2.0\" --excludePackages=timecode,rxjs/ajax,rxjs/fetch,rxjs/internal-compatibility,nw-pre-gyp-module-test,rxjs/operators,rxjs/testing,rxjs/webSocket,undefined,i18next-conv,@fortawesome/fontawesome-common-types,argv,indexof,custom-license,private,public-domain-module,@sofie-automation/corelib,@sofie-automation/shared-lib,@sofie-automation/job-worker",
2424
"lint": "run lint:raw .",
25-
"lint:raw": "eslint --ext .ts --ext .js --ext .tsx --ext .jsx",
25+
"lint:raw": "eslint",
2626
"lintfix": "run lint --fix",
2727
"quickformat": "prettier \"__mocks__/**\" --write ; prettier \"lib/**\" --write ; prettier \"server/**\" --write ; prettier \"client/**\" --write ; prettier \"*.json\" --write ; prettier \"*.js\" --write ; prettier \"*.md\" --write",
2828
"i18n-extract-pot": "node ./scripts/extract-i18next-pot.mjs -f \"{./lib/**/*.+(ts|tsx),./server/**/*.+(ts|tsx),../packages/job-worker/src/**/*.+(ts|tsx),../packages/corelib/src/**/*.+(ts|tsx),../packages/webui/src/**/*.+(ts|tsx)}\" -o i18n/template.pot",
@@ -77,8 +77,7 @@
7777
"@babel/core": "^7.26.7",
7878
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
7979
"@shopify/jest-koa-mocks": "^5.3.1",
80-
"@sofie-automation/code-standard-preset": "~2.4.7",
81-
"@sofie-automation/eslint-plugin": "^0.1.1",
80+
"@sofie-automation/code-standard-preset": "^3.0.0",
8281
"@types/app-root-path": "^1.2.8",
8382
"@types/body-parser": "^1.19.5",
8483
"@types/deep-extend": "^0.6.2",
@@ -92,27 +91,20 @@
9291
"@types/request": "^2.48.12",
9392
"@types/semver": "^7.5.8",
9493
"@types/underscore": "^1.13.0",
95-
"@typescript-eslint/eslint-plugin": "^5.62.0",
96-
"@typescript-eslint/parser": "^5.62.0",
97-
"@typescript-eslint/utils": "^5.62.0",
9894
"babel-jest": "^29.7.0",
9995
"ejson": "^2.2.3",
100-
"eslint": "^8.57.1",
101-
"eslint-config-prettier": "^8.10.0",
102-
"eslint-plugin-jest": "^27.9.0",
103-
"eslint-plugin-node": "^11.1.0",
104-
"eslint-plugin-prettier": "^4.2.1",
96+
"eslint": "^9.18.0",
10597
"fast-clone": "^1.5.13",
10698
"glob": "^8.1.0",
10799
"i18next-conv": "^10.2.0",
108100
"i18next-scanner": "^4.6.0",
109101
"jest": "^29.7.0",
110102
"legally": "^3.5.10",
111103
"open-cli": "^8.0.0",
112-
"prettier": "^2.8.8",
104+
"prettier": "^3.4.2",
113105
"standard-version": "^9.5.0",
114106
"ts-jest": "^29.2.5",
115-
"typescript": "~5.1.6",
107+
"typescript": "~5.7.3",
116108
"yargs": "^17.7.2"
117109
},
118110
"prettier": "@sofie-automation/code-standard-preset/.prettierrc.json",

meteor/server/systemStatus/systemStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const integrationVersionAllowPrerelease = isPrerelease(PackageInfo.version)
3434
// Any libraries that if a gateway uses should match a certain version
3535
const expectedLibraryVersions: { [libName: string]: string } = {
3636
'superfly-timeline': stripVersion(require('superfly-timeline/package.json').version),
37-
// eslint-disable-next-line node/no-extraneous-require
37+
// eslint-disable-next-line n/no-extraneous-require
3838
'@mos-connection/helper': stripVersion(require('@mos-connection/helper/package.json').version),
3939
}
4040

meteor/tsconfig-base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/* At the time of writing we are not ready for stricter rules */
55
"strict": true,
66

7+
"allowImportingTsExtensions": true,
78
"skipLibCheck": true,
89
"sourceMap": true,
910
"allowJs": false,

0 commit comments

Comments
 (0)