Add linting for JSON and workflow to test on push

main
Johannes Andersen 4 years ago
parent 9a7a17bf02
commit cd68f007fe
No known key found for this signature in database
GPG Key ID: 5D8D41426C95C066

@ -2,19 +2,18 @@ module.exports = {
root: true, root: true,
env: { env: {
browser: true, browser: true,
node: true node: true,
}, },
parserOptions: { parserOptions: {
parser: 'babel-eslint' parser: 'babel-eslint',
}, },
extends: [ extends: [
'@nuxtjs', '@nuxtjs',
'prettier', 'prettier',
'prettier/vue', 'prettier/vue',
'plugin:prettier/recommended', 'plugin:prettier/recommended',
'plugin:nuxt/recommended' 'plugin:nuxt/recommended',
], 'plugin:json/recommended',
plugins: [
'prettier'
], ],
plugins: ['prettier'],
} }

@ -0,0 +1,25 @@
name: Validate
on:
push:
pull_request:
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3
- uses: actions/setup-node@v2.1.2
with:
node-version: '14'
- name: Restore npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Validate
run: npm run validate

@ -8,15 +8,17 @@
"@nuxtjs/eslint-config": "^3.1.0", "@nuxtjs/eslint-config": "^3.1.0",
"@nuxtjs/eslint-module": "^2.0.0", "@nuxtjs/eslint-module": "^2.0.0",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"eslint": "^7.7.0", "eslint": "^7.13.0",
"eslint-config-prettier": "^6.11.0", "eslint-config-prettier": "^6.15.0",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-nuxt": "^1.0.0", "eslint-plugin-nuxt": "^1.0.0",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"prettier": "^2.1.0" "prettier": "^2.1.2"
}, },
"scripts": { "scripts": {
"link": "node ./bin/link.js", "link": "node ./bin/link.js",
"lint": "eslint --fix src/**/*.js", "lint": "eslint src/**/*.{js,json}",
"lint:fix": "eslint --fix src/**/*.{js,json}",
"validate": "yarn run lint && jsonlint -qV ./schema.json ./src/technologies.json && node ./bin/validate.js", "validate": "yarn run lint && jsonlint -qV ./schema.json ./src/technologies.json && node ./bin/validate.js",
"convert": "cd ./src/drivers/webextension/images/icons ; cp *.svg converted ; cd converted ; convert-svg-to-png *.svg --width 32 --height 32 ; rm *.svg", "convert": "cd ./src/drivers/webextension/images/icons ; cp *.svg converted ; cd converted ; convert-svg-to-png *.svg --width 32 --height 32 ; rm *.svg",
"prettify": "jsonlint -si --trim-trailing-commas --enforce-double-quotes ./src/technologies.json", "prettify": "jsonlint -si --trim-trailing-commas --enforce-double-quotes ./src/technologies.json",

@ -93,6 +93,6 @@
"categoryName71": { "message": "Affiliate program" }, "categoryName71": { "message": "Affiliate program" },
"categoryName72": { "message": "Appointment scheduling" }, "categoryName72": { "message": "Appointment scheduling" },
"categoryName73": { "message": "Surveys" }, "categoryName73": { "message": "Surveys" },
"categoryName75": { "message": "A/B testing" }, "categoryName74": { "message": "A/B testing" },
"categoryName75": { "message": "Email" } "categoryName75": { "message": "Email" }
} }

@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" viewBox="0 0 51 51" overflow="scroll">
<path fill="#FF7800" d="M5.6 1.4h39.9c2.3 0 4.2 1.8 4.2 4.2v39.9c0 2.3-1.8 4.2-4.2 4.2H5.6c-2.3 0-4.2-1.8-4.2-4.2V5.6c0-2.3 1.9-4.2 4.2-4.2z"/>
<path fill="#FEFEFE" d="M40.1 17.6c-3.2 0-6.1 1.9-7.3 4.8-1-2.3-3.5-4.8-6.9-4.8h-.4c-3.5 0-6.1 1.9-7.3 4.8-1.3-2.9-4.2-4.8-7.3-4.8-4.4 0-7.9 3.5-7.9 7.9v8h4v-7.9c0-2.3 1.9-4.2 4.2-4.2s4.2 1.9 4.2 4.2v7.9h3.8v-3.2c3.2 4.4 10.7 4.4 13.6-1h-5.4c-.4.4-1 .4-1.5.4-1.5 0-3.2-1-3.8-2.9h10.7c.4 3.8 3.8 6.7 7.6 6.7 4.4 0 8.2-3.5 8.2-7.9s-4.1-8-8.5-8zM22 23.5c.6-1.5 2.3-2.4 3.8-2.3 1.5.1 2.5 1 3.2 2.3h-7zm18.1 6.1c-2.3 0-4.2-1.9-4.2-4.2s1.9-4.2 4.2-4.2c2.5 0 4.4 1.9 4.4 4.2s-1.9 4.2-4.4 4.2z"/>
</svg>

Before

Width:  |  Height:  |  Size: 755 B