Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Commit

Permalink
build: add more lint rules (#176)
Browse files Browse the repository at this point in the history
* refactor: shorthand typescript config
* build(lint): add lint plugin
* refactor: lint all files
* build: add npm-run-all package
* chore: add parallel script
* chore: move eslint plugin to dev
* test: add snapshot tests
* refactor: prettier master json
  • Loading branch information
nogic1008 authored Feb 17, 2020
1 parent 0885ec1 commit f6e0c9f
Show file tree
Hide file tree
Showing 58 changed files with 7,396 additions and 224 deletions.
4 changes: 2 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ codecov:
coverage:
precision: 2
round: down
range: "70...100"
range: '70...100'

status:
project:
Expand All @@ -24,7 +24,7 @@ parsers:
macro: no

comment: # See: https://docs.codecov.io/docs/pull-request-comments
layout: "reach, diff, flags, files"
layout: 'reach, diff, flags, files'
behavior: default
require_changes: no
require_base: yes
Expand Down
18 changes: 9 additions & 9 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
version: 1
update_configs:
- package_manager: "javascript"
directory: "/"
update_schedule: "live"
- package_manager: 'javascript'
directory: '/'
update_schedule: 'live'
default_reviewers:
- "nogic1008"
- 'nogic1008'
default_labels:
- "dependabot:robot:"
- 'dependabot:robot:'
commit_message:
prefix: "fix"
prefix_development: "chore"
prefix: 'fix'
prefix_development: 'chore'
include_scope: true
automerged_updates:
- match:
dependency_type: "all"
update_type: "security:patch"
dependency_type: 'all'
update_type: 'security:patch'
10 changes: 7 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"root": true,
"env": {
"browser": true,
"node": true
"node": true,
"jest": true
},
"extends": [
"@nuxtjs/eslint-config-typescript",
Expand All @@ -11,9 +12,12 @@
"plugin:prettier/recommended",
"plugin:nuxt/recommended"
],
"plugins": ["prettier"],
"plugins": ["jest", "prettier", "simple-import-sort"],
"rules": {
"import/order": "off",
"no-process-env": "error",
"no-useless-constructor": "off"
"no-useless-constructor": "off",
"simple-import-sort/sort": "error",
"sort-imports": "off"
}
}
66 changes: 33 additions & 33 deletions .github/workflows/import-song.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@ jobs:
CI: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Use Cache # for optimize Install Dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install
run: npm ci
- name: Unit Test with Jest
run: npm test
- name: Import Data to Firebase
run: npm start
env:
FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }}
FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_SDK_PROJECT_ID }}
- name: Prettier Created Json
run: npx prettier -l "./static/*.json" --write
- name: Push Created Json Files
run: |
git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --local user.name ${GITHUB_ACTOR}
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
git checkout master
git add -A
git commit -m "feat(song): update master json from ${GITHUB_SHA}"
git push
- uses: actions/checkout@v1
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Use Cache # for optimize Install Dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install
run: npm ci
- name: Unit Test with Jest
run: npm test
- name: Import Data to Firebase
run: npm start
env:
FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }}
FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_SDK_PROJECT_ID }}
- name: Prettier Created Json
run: npx prettier -l "./static/*.json" --write
- name: Push Created Json Files
run: |
git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --local user.name ${GITHUB_ACTOR}
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
git checkout master
git add -A
git commit -m "feat(song): update master json from ${GITHUB_SHA}"
git push
102 changes: 51 additions & 51 deletions .github/workflows/node-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,54 @@ jobs:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Use Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci
- name: Build (Production)
run: npm run build
env:
FIREBASE_API_KEY: ${{ secrets.FIREBASE_SDK_API_KEY }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_SDK_PROJECT_ID }}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_SDK_MESSAGING_SENDER_ID }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_SDK_APP_ID }}
- name: Deploy to Firebase (Production)
uses: w9jds/firebase-action@v1.2.0
with:
args: deploy
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
PROJECT_ID: ${{ secrets.FIREBASE_SDK_PROJECT_ID }}
- name: Pack Artifact
run: zip -r dist ./dist
- name: Create Github Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.zip
asset_name: dist.zip
asset_content_type: application/zip
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Use Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci
- name: Build (Production)
run: npm run build
env:
FIREBASE_API_KEY: ${{ secrets.FIREBASE_SDK_API_KEY }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_SDK_PROJECT_ID }}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_SDK_MESSAGING_SENDER_ID }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_SDK_APP_ID }}
- name: Deploy to Firebase (Production)
uses: w9jds/firebase-action@v1.2.0
with:
args: deploy
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
PROJECT_ID: ${{ secrets.FIREBASE_SDK_PROJECT_ID }}
- name: Pack Artifact
run: zip -r dist ./dist
- name: Create Github Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.zip
asset_name: dist.zip
asset_content_type: application/zip
106 changes: 53 additions & 53 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,56 +25,56 @@ jobs:
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Setup Java 11
uses: actions/setup-java@v1
with:
java-version: 11
architecture: x64
- name: Use Cache # for optimize Install Dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci
- name: Install firestore Emulator
run: |
npm i -g firebase-tools
npx firebase setup:emulators:firestore
- name: Lint
run: npm run lint
- name: Build (Staging)
run: npm run build
- name: Run firestore Emulator & Test with Jest
run: firebase emulators:exec --only firestore "npm run test:all -- --ci"
- name: Report Code Coverage to codecov
uses: codecov/codecov-action@v1.0.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Deploy to Firebase (Staging)
if: matrix.is-main && github.event_name == 'push'
run: |
firebase use --add ddradar-staging
firebase deploy --only firestore
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
- name: Deploy to GitHub Pages
if: matrix.is-main && github.event_name == 'push'
run: |
echo staging.ddradar.app > ./dist/CNAME
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2/entrypoint.sh
bash ./entrypoint.sh
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist
INPUT_COMMITMESSAGE: "ci: auto deployment from"
INPUT_EMPTYCOMMITS: false
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Setup Java 11
uses: actions/setup-java@v1
with:
java-version: 11
architecture: x64
- name: Use Cache # for optimize Install Dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci
- name: Install firestore Emulator
run: |
npm i -g firebase-tools
npx firebase setup:emulators:firestore
- name: Lint
run: npm run lint
- name: Build (Staging)
run: npm run build
- name: Run firestore Emulator & Test with Jest
run: firebase emulators:exec --only firestore "npm run test:all -- --ci"
- name: Report Code Coverage to codecov
uses: codecov/codecov-action@v1.0.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Deploy to Firebase (Staging)
if: matrix.is-main && github.event_name == 'push'
run: |
firebase use --add ddradar-staging
firebase deploy --only firestore
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
- name: Deploy to GitHub Pages
if: matrix.is-main && github.event_name == 'push'
run: |
echo staging.ddradar.app > ./dist/CNAME
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2/entrypoint.sh
bash ./entrypoint.sh
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist
INPUT_COMMITMESSAGE: 'ci: auto deployment from'
INPUT_EMPTYCOMMITS: false
2 changes: 1 addition & 1 deletion .github/workflows/site-cat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- uses: ddradar/lgtm-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
image-url: "https://user-images.githubusercontent.com/24802730/74030931-9a21ac00-49f3-11ea-872e-374d5bd3e586.jpg"
image-url: 'https://user-images.githubusercontent.com/24802730/74030931-9a21ac00-49f3-11ea-872e-374d5bd3e586.jpg'
5 changes: 3 additions & 2 deletions components/ChartList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@
</template>

<script lang="ts">
import { Vue, Component, Prop } from 'nuxt-property-decorator'
import { getDifficultyName, Difficulty } from '@/types/difficulty'
import { Component, Prop, Vue } from 'nuxt-property-decorator'
import { Difficulty, getDifficultyName } from '@/types/difficulty'
import { getPlayStyleName, PlayStyle } from '@/types/play-style'
import { StepChart } from '@/types/step-chart'
Expand Down
2 changes: 1 addition & 1 deletion components/GrooveRadar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
</template>

<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
import Chart from 'chart.js'
import { Component, Prop, Vue } from 'vue-property-decorator'
@Component({
components: {
Expand Down
6 changes: 3 additions & 3 deletions components/ReactiveRadar.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { Mixins } from 'vue-property-decorator'
import { Component, Prop } from 'nuxt-property-decorator'
import Chart from 'chart.js'
import { Radar, mixins } from 'vue-chartjs'
import { Component, Prop } from 'nuxt-property-decorator'
import { mixins, Radar } from 'vue-chartjs'
import { Mixins } from 'vue-property-decorator'
@Component({})
export default class ReactiveRadar extends Mixins(Radar, mixins.reactiveProp) {
Expand Down
Loading

0 comments on commit f6e0c9f

Please sign in to comment.