@sofie-automation/code-standard-preset v2.5.2
Sofie: The Modern TV News Studio Automation System (code standard preset)
This library is used in the Sofie TV News Studio Automation System for defining a code standard preset through eslint and prettier. Besides that a script for checking compatible licenses is included.
Installation
yarn add @sofie-automation/code-standard-preset
Add the following information to your package.json
:
{
...,
"scripts": {
...,
"lint": "eslint . --ext .ts --ignore-pattern dist",
"license-validate": "yarn sofie-licensecheck -r --filter MIT --filter 0BSD --filter BSD --filter ISC --filter Apache --filter Unlicense --plain --border ascii"
},
"prettier": "@sofie-automation/code-standard-preset/.prettierrc.json",
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,css,json,md,scss}": [
"prettier --write"
],
"*.{ts,tsx}": [
"npm run lint --fix"
]
},
...
}
Add the following files:
.eslintrc.json
{
"extends": "./node_modules/@sofie-automation/code-standard-preset/eslint/main"
}
tsconfig.json
{
"extends": "@sofie-automation/code-standard-preset/ts/tsconfig.lib",
"exclude": ["node_modules/**"]
}
tsconfig.build.json
{
"extends": "@sofie-automation/code-standard-preset/ts/tsconfig.lib",
"exclude": ["node_modules/**", "src/**/*spec.ts", "src/**/__tests__/*", "src/**/__mocks__/*"],
"compilerOptions": {
"outDir": "./dist",
"baseUrl": "./",
"paths": {
"*": ["./node_modules/*"],
"{{PACKAGE-NAME}}": ["./src/index.ts"],
"types": ["node", "jest"]
}
}
}
Note: replace the {{PACKAGE-NAME}} with the correct package name, i.e. hyperdeck-connection
Additionally you may want to include a .gitattributes file:
* text=auto eol=lf
9 months ago
7 months ago
9 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago