Skip to content

Commit

Permalink
chore: prettier + other cleanup (#29)
Browse files Browse the repository at this point in the history
* chore: prettier + other cleanup

* fix: don't run linter before tests
  • Loading branch information
kanadgupta committed Nov 6, 2023
1 parent 8005069 commit 189e9c2
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 32 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

5 changes: 1 addition & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"extends": [
"@readme/eslint-config",
"@readme/eslint-config/typescript"
],
"extends": ["@readme/eslint-config", "@readme/eslint-config/typescript"],
"root": true
}
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
directory: '/'
schedule:
interval: monthly
reviewers:
Expand All @@ -13,7 +13,7 @@ updates:
prefix-development: chore(deps-dev)

- package-ecosystem: npm
directory: "/"
directory: '/'
schedule:
interval: monthly
open-pull-requests-limit: 10
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ jobs:
node-version: ${{ matrix.node }}
cache: 'npm'

- run: npm ci
- run: npx vitest
- run: npm cit
24 changes: 12 additions & 12 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
schedule:
- cron: '0 0 1 * *'

Expand All @@ -20,16 +20,16 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ['javascript']

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ npm install --save @readme/ua-platformer
import uaPlatformer from '@readme/ua-platformer';
// const { default: uaPlatformer } = require('@readme/ua-platformer');

const useragent = 'Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.22000.832'
const useragent = 'Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.22000.832';

console.log(uaPlatformer(useragent)); // { name: 'PowerShell', browser: false }
```

## Examples

<!-- prettier-ignore-start -->
| User Agent | Platform |
| :--- | :--- |
| Amazon Cloudfront | `Amazon` |
Expand All @@ -33,3 +34,4 @@ console.log(uaPlatformer(useragent)); // { name: 'PowerShell', browser: false }
| rdme-github/8.1.1 | `ReadMe` |
| Typhoeus - https://github.com/typhoeus/typhoeus | `Ruby` |
| WordPress/6.0.3; https://example.com | `PHP` |
<!-- prettier-ignore-end -->
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
"keywords": [
"user agent"
],
"files": ["dist"],
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"lint": "eslint . --ext .js,.ts",
"lint": "npm run lint:ts && npm run prettier",
"lint:ts": "eslint . --ignore-path .gitignore --ext js,ts",
"prebuild": "rm -rf dist/",
"prepack": "npm run build",
"pretest": "npm run lint",
"prettier": "prettier --list-different --write \"./**/**.{js,ts}\"",
"prettier": "prettier --check .",
"prettier:write": "prettier --check --write .",
"test": "vitest run --coverage"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noImplicitAny": false,
"noImplicitAny": false
},
"include": ["../src/**/*", "*.ts", "**/*"],
"include": ["../src/**/*", "*.ts", "**/*"]
}

0 comments on commit 189e9c2

Please sign in to comment.