Skip to content

Instantly share code, notes, and snippets.

@gagarine
Last active March 17, 2021 07:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gagarine/76d430e73d15c158e1d5d0136b1073ed to your computer and use it in GitHub Desktop.
Save gagarine/76d430e73d15c158e1d5d0136b1073ed to your computer and use it in GitHub Desktop.
package.json with npm script and config for webextension, can be addapted for any JS/HTML app or website.
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}
{
"attr-lowercase": true,
"attr-no-duplication": true,
"attr-unsafe-chars": true,
"attr-value-double-quotes": true,
"attr-value-not-empty": true
"doctype-first": true,
"doctype-html5": true,
"id-class-value": "dash",
"id-unique": true,
"inline-script-disabled": true,
"inline-style-disabled": true,
"space-tab-mixed-disabled": "space",
"spec-char-escape": true,
"src-not-empty": true,
"tag-pair": true,
"tagname-lowercase": true,
"title-require": false,
}
{
"extends": "stylelint-config-standard"
}
{
"name": "my-extension",
"version": "0.0.1",
"description": "Super Extension.",
"main": "index.js",
"repository": "github:username/my-extension.git",
"author": "you",
"license": "MIT",
"dependencies": {
},
"devDependencies": {
"concurrently": "^3.4.0",
"eslint": "^3.19.0",
"eslint-config-google": "^0.7.1",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"htmlhint": "^0.9.13",
"node-sass": "^4.5.2",
"stylelint": "^7.10.1",
"stylelint-config-standard": "^16.0.0"
},
"scripts": {
"sass": "node-sass src/scss/main.scss --output src/css --source-map-embed --source-map-contents",
"watch:sass": "npm run sass -- --watch",
"lint:js": "eslint --config .eslintrc.json src;",
"lint:style": "stylelint --config .stylelintrc src/scss/*.scss;",
"lint:html": "htmlhint --config .htmlhintrc src/**/*.html;",
"lint": "concurrently --names lint:html, lint:style, lint:js -p name 'npm run lint:html' 'npm run lint:style' 'npm run lint:js';",
"zip": "mkdir -p build && zip -r build/myapp.zip ./src/*",
"build": "lint && npm run sass && npm run zip"
}
}
@gagarine
Copy link
Author

gagarine commented Apr 17, 2017

First run yarn install or npm install then to build sass simply run npm run sass, to build and watch npm run watch:sass and to run linters npm run lint. You get the idea...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment