Skip to content

Commit b0bd5d2

Browse files
committed
chore: add lint, fmt, and CI tooling
1 parent f6b55f8 commit b0bd5d2

File tree

7 files changed

+92
-0
lines changed

7 files changed

+92
-0
lines changed

.github/workflows/node.js.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Node.js CI
2+
on:
3+
push:
4+
branches: ['main']
5+
pull_request:
6+
jobs:
7+
build:
8+
name: "Fmt, Lint, & Test"
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version:
13+
#- 20.x
14+
- latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- run: node --version
22+
- run: npm run fmt
23+
- run: npm ci
24+
- run: npm run lint
25+
- run: npm run test

.jshintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DELETEMEnode_modules/**/*

.jshintrc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"browser": true,
3+
"node": true,
4+
"esversion": 11,
5+
"curly": true,
6+
"sub": true,
7+
8+
"bitwise": true,
9+
"eqeqeq": true,
10+
"forin": true,
11+
"freeze": true,
12+
"immed": true,
13+
"latedef": "nofunc",
14+
"nonbsp": true,
15+
"nonew": true,
16+
"plusplus": true,
17+
"undef": true,
18+
"unused": "vars",
19+
"strict": true,
20+
"maxdepth": 4,
21+
"maxstatements": 100,
22+
"maxcomplexity": 20
23+
}

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
jsconfig.json
3+
package.json
4+
package-lock.json

.prettierrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"bracketSpacing": true,
3+
"printWidth": 80,
4+
"proseWrap": "always",
5+
"singleQuote": true,
6+
"tabWidth": 2,
7+
"trailingComma": "all",
8+
"semi": true
9+
}

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "build-classifier",
3+
"version": "0.9.0",
4+
"description": "Determine Host Target Triplet (Arch, Libc, OS, Vendor) from a filenames / download URL and uname / User-Agent strings.",
5+
"main": "index.js",
6+
"scripts": {
7+
"fmt": "npm run prettier",
8+
"lint": "npm run jshint",
9+
"test": "node lexver-test.js",
10+
"----": "------------------------------------",
11+
"jshint": "npx -p [email protected] -- jshint -c ./.jshintrc --exclude 'node_modules/**/*' *.js",
12+
"prettier": "npx -p [email protected] -- prettier -w '**/*.{js,md,html}'"
13+
},
14+
"keywords": [],
15+
"author": "AJ ONeal <[email protected]> (https://therootcompany.com/)",
16+
"license": "SEE LICENSE IN LICENSE"
17+
}

0 commit comments

Comments
 (0)