Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
test:
docker:
# specify the version you desire here
- image: circleci/node:12.13
- image: circleci/node:16

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules/*
/coverage/*
/build/*
/.vscode/*
/dist/*
78 changes: 78 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["prettier"],
"env": {
"es6": true,
"commonjs": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 9
},
"rules": {
"strict": [2, "global"],
"no-duplicate-imports": [2, { "includeExports": true }],

"eqeqeq": 2,
"block-scoped-var": 2,
"no-constant-condition": 2,
"no-console": 2,
"no-debugger": 2,
"no-lonely-if": 2,
"no-lone-blocks": 2,
"no-nested-ternary": 2,
"no-dupe-keys": 2,
"no-extra-boolean-cast": 2,
"no-irregular-whitespace": 2,
"no-else-return": 2,
"no-eval": 2,
"no-multi-str": 2,
"no-self-compare": 2,
"no-useless-call": 2,
"no-shadow-restricted-names": 2,
"no-shadow": 2,
"no-undef": 2,
"no-undef-init": 2,
"no-unreachable": 2,
"no-unused-vars": 2,
"no-use-before-define": 2,

"radix": 2,
"curly": 2,
"no-fallthrough": 2,
"default-case": 2,

"no-var": 2,
"no-unused-expressions": 2,
"camelcase": [
2,
{
"properties": "always",
"allow": ["^UNSAFE_"]
}
],
"@typescript-eslint/no-explicit-any": 2,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/type-annotation-spacing": 0,
"@typescript-eslint/no-unused-vars": 2,
"@typescript-eslint/no-use-before-define": 2
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"no-use-before-define": 0,
"no-shadow": 0,
"no-undef": 0
}
}
]
}
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ npm-debug.log*
tsconfig.dist.json
tsconfig.excludes.json
tsconfig.json
tslint.json
.eslintrc.json
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.13.0
16.14.2
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,41 @@ If you want to include a file that is excluded by your `tsconfig.json` you shoul
Regardless of your includes or excludes `node_modules` will always be excluded.

Run `tsassert --help` for a full list of options.

## Contributing

### Setup

Ensure you are using a compatible version of NodeJS (16) and NPM (8).

If you're using NVM you can simply:

```shell
nvm use
```

And ensure you have NPM 8 installed globally:

```shell
npm i npm@8 -g
```

Then run a clean install to get fresh dependencies:

```shell
npm ci
```

### Scripts

Run type-checking, linting and tests with:

```shell
npm test
```

You can fix formatting issues by running:

```shell
npm run prettier
```
1 change: 0 additions & 1 deletion assertions/fail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class MyClass<T> {
}
}

// tslint:disable-next-line:no-unused-expression
new MyClass(abc); // @tsassert: MyClass<CBA | null>

// @tsassert: ABC
Expand Down
1 change: 0 additions & 1 deletion assertions/pass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class MyClass<T> {
}
}

// tslint:disable-next-line:no-unused-expression
new MyClass(abc); // @tsassert: MyClass<ABC | null>

// @tsassert: ABC
Expand Down
Loading