Skip to content

Commit 897e122

Browse files
committed
Applied prettier
1 parent f63bf2f commit 897e122

15 files changed

+437
-353
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: ' ⚠️ Bug report'
3+
about: Create a report to help us improve
4+
title: ' ⚠️ Name of the issue'
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
Provide you OS version information
28+
29+
**NPM Version**
30+
31+
<!--Run `npm version` command -->
32+
33+
```
34+
Paste result here
35+
```
36+
37+
**NPM Package versions**
38+
39+
<!--Run `npm list --depth 0` command -->
40+
41+
```
42+
Paste result here
43+
```
44+
45+
**Additional context**
46+
Add any other context about the problem here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: ' ⭐ Feature request'
3+
about: Suggest an idea for this project
4+
title: ' ⭐ Name of the issue'
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
version: 2
22
updates:
3-
# Fetch and update latest `npm` packages
4-
- package-ecosystem: npm
5-
directory: '/'
6-
schedule:
7-
interval: daily
8-
time: '00:00'
9-
open-pull-requests-limit: 10
10-
reviewers:
11-
- toliak
12-
assignees:
13-
- toliak
14-
commit-message:
15-
prefix: fix
16-
prefix-development: chore
17-
include: scope
18-
# Fetch and update latest `github-actions` pkgs
19-
- package-ecosystem: github-actions
20-
directory: '/'
21-
schedule:
22-
interval: daily
23-
time: '00:00'
24-
open-pull-requests-limit: 10
25-
reviewers:
26-
- toliak
27-
assignees:
28-
- toliak
29-
commit-message:
30-
prefix: fix
31-
prefix-development: chore
32-
include: scope
3+
# Fetch and update latest `npm` packages
4+
- package-ecosystem: npm
5+
directory: '/'
6+
schedule:
7+
interval: daily
8+
time: '00:00'
9+
open-pull-requests-limit: 10
10+
reviewers:
11+
- toliak
12+
assignees:
13+
- toliak
14+
commit-message:
15+
prefix: fix
16+
prefix-development: chore
17+
include: scope
18+
# Fetch and update latest `github-actions` pkgs
19+
- package-ecosystem: github-actions
20+
directory: '/'
21+
schedule:
22+
interval: daily
23+
time: '00:00'
24+
open-pull-requests-limit: 10
25+
reviewers:
26+
- toliak
27+
assignees:
28+
- toliak
29+
commit-message:
30+
prefix: fix
31+
prefix-development: chore
32+
include: scope

.github/workflows/package.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: NPM Package
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- '**.md'
7+
push:
8+
paths-ignore:
9+
- '**.md'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Setup node 12
17+
uses: actions/[email protected]
18+
with:
19+
node-version: 12.x
20+
- name: Cache Node files
21+
uses: actions/[email protected]
22+
env:
23+
cache-name: cache-node-modules
24+
with:
25+
# npm cache files are stored in `~/.npm` on Linux/macOS
26+
path: |
27+
~/.npm
28+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-build-${{ env.cache-name }}-
31+
${{ runner.os }}-build-
32+
${{ runner.os }}-
33+
- run: npm ci
34+
- run: npm run prettier
35+
- run: npm run build

.prettierrc.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"$schema": "http://json.schemastore.org/prettierrc",
3-
"arrowParens": "avoid",
4-
"singleQuote": true,
5-
"trailingComma": "all",
6-
"tabWidth": 4,
7-
"printWidth": 120,
8-
"semi": true
9-
}
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"arrowParens": "avoid",
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"tabWidth": 4,
7+
"printWidth": 120,
8+
"semi": true
9+
}

.vscode/extensions.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"recommendations": [
3-
"gruntfuggly.triggertaskonsave"
4-
]
5-
}
2+
"recommendations": ["gruntfuggly.triggertaskonsave"]
3+
}

.vscode/settings.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"triggerTaskOnSave.tasks": {
3-
"npm: build": [
4-
"src/**/*.ts"
5-
]
3+
"npm: build": ["src/**/*.ts"]
64
},
75
"typescript.tsdk": "node_modules/typescript/lib",
86
"typescript.preferences.includePackageJsonAutoImports": "on"
9-
}
7+
}

.vscode/tasks.json

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
{
2-
"version": "2.0.0",
3-
"tasks": [
4-
{
5-
"type": "npm",
6-
"script": "build",
7-
"problemMatcher": [
8-
"$tsc"
9-
],
10-
"group": "build",
11-
"label": "npm: build",
12-
"detail": "tstl",
13-
}
14-
]
15-
}
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "build",
7+
"problemMatcher": ["$tsc"],
8+
"group": "build",
9+
"label": "npm: build",
10+
"detail": "tstl"
11+
}
12+
]
13+
}

README.md

+18-20
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
# TypeScript Resource Boilerplate for MTASA
22

3-
Write and compile TypeScript code to Lua.
3+
Write and compile TypeScript code to Lua.
44

5-
A documentation in your IDE. Types safety. Linting.
5+
A documentation in your IDE. Types safety. Linting.
66

77
**Features**
88

9-
- 🔥 [TypeScriptToLua](https://www.npmjs.com/package/typescript-to-lua)
10-
Provides compilation.
9+
- 🔥 [TypeScriptToLua](https://www.npmjs.com/package/typescript-to-lua)
10+
Provides compilation.
1111

12-
- 📓 [MTASA Lua Types](https://www.npmjs.com/package/mtasa-lua-types)
13-
Provides types declarations and the documentation for MTASA Functions and classes.
12+
- 📓 [MTASA Lua Types](https://www.npmjs.com/package/mtasa-lua-types)
13+
Provides types declarations and the documentation for MTASA Functions and classes.
1414

15-
-[MTASA Lua Utils](https://www.npmjs.com/package/mtasa-lua-utils)
16-
Provides code preparation and MTASA specific linting.
17-
18-
- ✒️ [Prettier](https://www.npmjs.com/package/prettier)
19-
Code formatter
20-
21-
- ⌛ In the future: **ESLint** for linting TypeScript Code
15+
-[MTASA Lua Utils](https://www.npmjs.com/package/mtasa-lua-utils)
16+
Provides code preparation and MTASA specific linting.
17+
- ✒️ [Prettier](https://www.npmjs.com/package/prettier)
18+
Code formatter
19+
- ⌛ In the future: **ESLint** for linting TypeScript Code
2220

2321
# Getting started
2422

@@ -31,13 +29,13 @@ Installation for [Windows](https://nodejs.org/en/download/).
3129

3230
Installation for Linux:
3331

34-
*Debian or Ubuntu*
32+
_Debian or Ubuntu_
3533

3634
```shell
3735
apt install nodejs
3836
```
3937

40-
*Arch or Manjaro*
38+
_Arch or Manjaro_
4139

4240
```shell
4341
pacman -S nodejs
@@ -55,7 +53,7 @@ npm version
5553

5654
## Download boilerplate
5755

58-
The boilerplate should be downloaded into the
56+
The boilerplate should be downloaded into the
5957
[resources folder](https://wiki.multitheftauto.com/wiki/Resources#:~:text=This%20is%20located).
6058

6159
You can use `git`:
@@ -85,7 +83,7 @@ Command:
8583
npm run build
8684
```
8785

88-
Always running the command to build the resource is annoying.
86+
Always running the command to build the resource is annoying.
8987
Below there are possible solutions to simplify it.
9088

9189
# Code Editor Preparation
@@ -121,7 +119,7 @@ Configuration provided in [.vscode/settings.json](.vscode/settings.json) and wil
121119

122120
**NOTE**: In the current version configuration should have been loaded by default.
123121

124-
In the top right corner press `Edit Configurations`.
122+
In the top right corner press `Edit Configurations`.
125123
Press `Add New Configuration` (Plus icon), select `npm` and select **build** in `Scripts` field.
126124

127125
![Configuration](https://i.imgur.com/79iD3fW.png)
@@ -134,10 +132,10 @@ Now you can press `Shift+F10` to compile your resource.
134132

135133
Compile can be executed after file saving.
136134

137-
Open `Settings` -> `Tools` -> `File watchers`.
135+
Open `Settings` -> `Tools` -> `File watchers`.
138136
Add new file watcher for TypeScript files in project scope.
139137
Put **npm** into the `Script` field and **run build** into the `Srguments` field.
140138

141139
![File Watcher](https://i.imgur.com/NuLtNH3.png)
142140

143-
Thus, saving after editing TypeScript files triggers compilation.
141+
Thus, saving after editing TypeScript files triggers compilation.

0 commit comments

Comments
 (0)