Skip to content

Commit

Permalink
feat: install Prettier (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robot-Inventor authored Apr 15, 2024
1 parent 4abe157 commit 7073abd
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 38 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Node.js CI (format)

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
format:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [21.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run format:check
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 120,
"tabWidth": 4,
"trailingComma": "none"
}
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"scripts": {
"build": "webpack",
"watch": "webpack --watch",
"format": "prettier --write ./src/**/*",
"format:check": "prettier --check ./src/**/*",
"package": "ts-node ./script/package.ts",
"version": "npm run build && git add ."
},
Expand All @@ -28,6 +30,7 @@
"async-query": "^1.0.4",
"chokidar": "^3.6.0",
"copy-webpack-plugin": "^12.0.2",
"prettier": "^3.2.5",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"twi-ext": "^0.5.2",
Expand Down
File renamed without changes
16 changes: 4 additions & 12 deletions src/manifest/v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,9 @@
},
"content_scripts": [
{
"matches": [
"https://twitter.com/*",
"https://mobile.twitter.com/*",
"https://pro.twitter.com/*"
],
"js": [
"js/loader.js"
]
"matches": ["https://twitter.com/*", "https://mobile.twitter.com/*", "https://pro.twitter.com/*"],
"js": ["js/loader.js"]
}
],
"web_accessible_resources": [
"js/main.js"
]
}
"web_accessible_resources": ["js/main.js"]
}
28 changes: 6 additions & 22 deletions src/manifest/v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,17 @@
"icons": {
"128": "image/icon.png"
},
"host_permissions": [
"https://twitter.com/*",
"https://mobile.twitter.com/*",
"https://pro.twitter.com/*"
],
"host_permissions": ["https://twitter.com/*", "https://mobile.twitter.com/*", "https://pro.twitter.com/*"],
"content_scripts": [
{
"matches": [
"https://twitter.com/*",
"https://mobile.twitter.com/*",
"https://pro.twitter.com/*"
],
"js": [
"js/loader.js"
]
"matches": ["https://twitter.com/*", "https://mobile.twitter.com/*", "https://pro.twitter.com/*"],
"js": ["js/loader.js"]
}
],
"web_accessible_resources": [
{
"resources": [
"js/main.js"
],
"matches": [
"https://twitter.com/*",
"https://mobile.twitter.com/*",
"https://pro.twitter.com/*"
]
"resources": ["js/main.js"],
"matches": ["https://twitter.com/*", "https://mobile.twitter.com/*", "https://pro.twitter.com/*"]
}
]
}
}
8 changes: 4 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ module.exports = {
new CopyFilePlugin({
patterns: [
{
context: "./src/image/",
context: "./public/",
from: "**/*",
to: "chrome/image/"
to: "chrome/"
},
{
context: "./src/image/",
context: "./public/",
from: "**/*",
to: "firefox/image/"
to: "firefox/"
},
{
from: "./*LICENSE",
Expand Down

0 comments on commit 7073abd

Please sign in to comment.