Gathering detailed insights and metrics for @moia-oss/eslint-prettier-typescript-config
Gathering detailed insights and metrics for @moia-oss/eslint-prettier-typescript-config
Gathering detailed insights and metrics for @moia-oss/eslint-prettier-typescript-config
Gathering detailed insights and metrics for @moia-oss/eslint-prettier-typescript-config
Documentation on how to get started with linting and formatting in a TypeScript project
npm install @moia-oss/eslint-prettier-typescript-config
Typescript
Module System
Node Version
NPM Version
52.4
Supply Chain
91.7
Quality
70.7
Maintenance
100
Vulnerability
94.8
License
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
8 Stars
473 Commits
3 Forks
7 Watchers
1 Branches
20 Contributors
Updated on Mar 31, 2025
Latest Version
3.0.9
Package Id
@moia-oss/eslint-prettier-typescript-config@3.0.9
Unpacked Size
49.21 kB
Size
15.00 kB
File Count
32
NPM Version
10.5.0
Node Version
20.12.2
Published on
May 06, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Shared MOIA TypeScript, eslint and prettier configuration
Install
1npm install -D typescript eslint prettier 2npm install -D @moia-oss/eslint-prettier-typescript-config 3 4# in some cases, you may need to install these packages directly: 5npm install -D @typescript-eslint/parser @typescript-eslint/eslint-plugin
Link configurations
(customise paths as needed)
tsconfig.json
1{ 2 "extends": "@moia-oss/eslint-prettier-typescript-config", 3 "compilerOptions": { 4 "outDir": "./build", 5 "rootDir": "./src", 6 }, 7 "include": ["./src"], 8}
.eslintrc
(remove react
and strict
if not required. more info further down in this README).
1{ 2 "extends": [ 3 "./node_modules/@moia-oss/eslint-prettier-typescript-config/config/eslint", 4 "./node_modules/@moia-oss/eslint-prettier-typescript-config/config/eslint-react", 5 "./node_modules/@moia-oss/eslint-prettier-typescript-config/config/eslint-strict", 6 ], 7 // Only add if you have a CDK directory, customise path as needed 8 "overrides": [ 9 { 10 "files": ["cdk/**/*"], 11 "extends": [ 12 "./node_modules/@moia-oss/eslint-prettier-typescript-config/config/eslint-cdk", 13 ], 14 }, 15 ], 16}
.prettierrc
1"@moia-oss/eslint-prettier-typescript-config/config/prettier"
Add scripts to package.json
(customise paths as needed)
1{ 2 "scripts": { 3 "build": "tsc", 4 "lint": "eslint ./src/", 5 "format": "prettier . --write", 6 "format:check": "prettier . --check", 7 }, 8}
Done! Don't forget to run build
, lint
and format:check
in your CI workflow.
The strict config enables a few more things that not every team may want:
Arrow (expression) function style preferred:
1// Not allowed 2 3function foo() { 4 return 1; 5} 6 7// Allowed 8 9const foo = () => { 10 return 1; 11};
Type assertions not allowed:
Due to the design goal of type erasure (no runtime overhead), type assertions are not ever checked.
When you assert a type, it may look suspiciously like type casting in a language such as Kotlin, but it isn't the same thing. TypeScript just "trusts" you and doesn't check the type.
At runtime, you wouldn't get a cast error if the type is not the same, but only see a problem if you try to access or use a value that doesn't match the expected type.
Use parsing libraries such as zod.
1// Error: 2 3type Foo = { 4 x: 1; 5}; 6// no error thrown, silently continues 7const foo = JSON.parse('{"y":1}') as Foo; 8 9// evauluates silently to NaN: 10foo.x + 1; 11 12// this also silently continues: 13const bar = JSON.parse('{"xyz":1}') as { x: { y: number } }; 14 15// you won't see a problem in runtime until somewhere 16// else in the code, making it hard to trace: 17 18// throws `Uncaught TypeError: Cannot read property 'y' of undefined` 19console.log(bar.x.y);
1// OK:
2import * as z from 'zod';
3
4const FooSchema = z.object({
5 x: z.number(),
6});
7
8type Foo = z.infer<typeof FooSchema>;
9
10// parses successfully
11const foo = FooSchema.parse(JSON.parse('{"x":1}'));
12
13// throws an error detailing why the JSON doesn't match
14const bar = FooSchema.parse(JSON.parse('{"y":1}'));
VSCode lint/format settings in .vscode/settings.json
1{ 2 "editor.formatOnSave": true, 3 "editor.defaultFormatter": "esbenp.prettier-vscode", 4 "editor.codeActionsOnSave": { 5 "source.fixAll.eslint": true, 6 }, 7}
VSCode extension recommendations in .vscode/extensions.json
1{ "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] }
.editorconfig
1[*] 2end_of_line = lf 3insert_final_newline = true 4charset = utf-8 5indent_style = space 6indent_size = 2
This relates to the development of this package. Ignore this section as a consumer.
This package uses its own exported config to build, lint and format itself. This also makes sure that the configs are valid, as the steps are run during the GitHub Actions build step.
Because of this, you must run npm run build
before linting or formatting during development
Husky is used to introduce git hooks.
Link to the package https://typicode.github.io/husky/
To install them, execute npm run husky:prepare
We will automatically release on push to main. Make sure to update the package version according to your change following semantic versioning
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 10/14 approved changesets -- score normalized to 7
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More