2.5.2 • Published 7 months ago

@sofie-automation/code-standard-preset v2.5.2

Weekly downloads
1,888
License
MIT
Repository
github
Last release
7 months ago

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
2.5.0

9 months ago

2.5.2

7 months ago

2.5.1

9 months ago

2.4.7

12 months ago

2.4.1

1 year ago

2.4.0

1 year ago

2.4.6

1 year ago

2.3.1

1 year ago

2.3.0

1 year ago

2.2.0

1 year ago

2.1.0

2 years ago

2.0.3-0

2 years ago

2.0.2

2 years ago

1.1.1

2 years ago

2.0.1

2 years ago

1.0.0

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

0.5.1

2 years ago

0.5.0

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago