Skip to content

Commit

Permalink
TSify (#27)
Browse files Browse the repository at this point in the history
* TSified

* Fixed eslint rules

* Dependency package version updates

* Changed MR template

* Update node versions
  • Loading branch information
TarSzator authored May 12, 2024
1 parent 2795a75 commit 4892471
Show file tree
Hide file tree
Showing 57 changed files with 7,927 additions and 26,288 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
build/
14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

88 changes: 88 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "@stylistic", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"airbnb-base",
"airbnb-typescript/base",
"prettier",
"plugin:@stylistic/disable-legacy"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
// Below this line rule exist to remove overlap with prettify
"@stylistic/brace-style": "off",
"@stylistic/indent": "off",
// Above this line rule exist to remove overlap with prettify
"@stylistic/lines-between-class-members": ["error", "always", { "exceptAfterOverload": true }],
"class-methods-use-this": "off",
"no-param-reassign": [
"error",
{
"props": false
}
],
"no-underscore-dangle": "error",
"import/extensions": ["error", "always", { "ignorePackages": true }],
"import/prefer-default-export": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["camelCase"]
},
{
"selector": "property",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE", "PascalCase"]
},
{
"selector": "parameter",
"format": ["camelCase", "PascalCase"],
"leadingUnderscore": "allow"
},
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": "enumMember",
"format": ["PascalCase"]
},
{
"selector": "objectLiteralProperty",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "import",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "classProperty",
"format": ["camelCase"],
"leadingUnderscore": "allow"
}
],
"@typescript-eslint/array-type": [
"error",
{
"default": "array"
}
],
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "args": "all" }]
}
}
15 changes: 6 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
### What does this PR/MR do?
## What does this PR/MR do?

## Where should the reviewer start?

### Where should the reviewer start?
## Recommendation for how to test this it manually, or anything you are worried about?

## Does anything else need to be done (notify someone, other issue, etc) before me deploying?

### Recommendation for how to test this it manually, or anything you are worried about?
## What gif describes how you feel about this PR?


### Does anything else need to be done (notify someone, other issue, etc) before me deploying?


### What gif describes how you feel about this PR?
![gif]()
![gif](https://media.giphy.com/media/3o7TKHKjrDyqphX9Cg/giphy.gif)
25 changes: 12 additions & 13 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ on: [push, pull_request]

jobs:
test:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
env:
CI: true
TEST_SECR: ${{secrets.TEST_SECR}}
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
env:
CI: true
TEST_SECR: ${{secrets.TEST_SECR}}
85 changes: 77 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,78 @@
**/node_modules
**/.idea
**/.DS_STORE
report
build
tmp/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log*
firebase-debug.*.log*
pnpm-debug.log*
lerna-debug.log*

# Firebase cache
.firebase/

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
dist
.cache

# junit
coverage
junit.xml
gl-codequality.json

# Apple
.DS_*

# Build output
build/

# Configs and Environments
.npmrc
.npmtoken
.env
.env.*
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
9 changes: 9 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

case $- in
*i*) echo This shell is already interactive;;
*) exec < /dev/tty && echo This shell is now interactive;;
esac

npm test && npm run lint && npm run jscpd && npm run build
13 changes: 13 additions & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"threshold": 0,
"reporters": ["consoleFull"],
"ignore": [
"node_modules/**",
"build/**",
"**/*.test.[tj]s",
"coverage/**",
"**/package.json",
".idea/**"
],
"absolute": true
}
12 changes: 3 additions & 9 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
**/node_modules
**/.idea
**/.DS_STORE
report
tmp/
.env
dist
.cache
.github
.*
src/
tsconfig.*
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build/
node_modules/
package-lock.json
/html
/coverage
.yo-rc.json
17 changes: 13 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
{
"printWidth": 80,
"trailingComma": "all",
"tabWidth": 2,
"useTabs": false,
"semi": true,
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all"
"semi": true,
"bracketSpacing": true,
"bracketSameLine": true,
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.mts"],
"options": {
"parser": "typescript"
}
}
]
}
41 changes: 41 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"git": {
"requireUpstream": true,
"requireCleanWorkingDir": true,
"commit": true,
"commitMessage": "${version}",
"commitArgs": ["--no-verify"],
"push": true,
"pushArgs": ["--no-verify", "--follow-tags"],
"tag": true,
"tagName": "v${version}",
"tagAnnotation": "v${version}"
},
"npm": {
"publish": false
},
"github": {
"release": true
},
"gitlab": {
"release": false
},
"hooks": {
"before:bump": ["npm run validateChangelog", "npm ci", "npm test", "npm run lint", "npm run jscpd", "npm run build"]
},
"plugins": {
"@release-it/keep-a-changelog": {
"filename": "CHANGELOG.md",
"strictLatest": true,
"addUnreleased": true,
"addVersionUrl": true,
"head": "master",
"versionUrlFormats": {
"repositoryUrl": "https://{host}/{repository}",
"unreleasedUrl": "{repositoryUrl}/compare/{tagName}...{head}",
"versionUrl": "{repositoryUrl}/compare/{previousTag}...{tagName}",
"firstVersionUrl": "{repositoryUrl}/tree/{tagName}"
}
}
}
}
Loading

0 comments on commit 4892471

Please sign in to comment.