Last active
March 17, 2021 07:52
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"browser": true, | |
"es6": true | |
}, | |
"extends": "eslint:recommended", | |
"rules": { | |
"indent": [ | |
"error", | |
4 | |
], | |
"linebreak-style": [ | |
"error", | |
"unix" | |
], | |
"quotes": [ | |
"error", | |
"single" | |
], | |
"semi": [ | |
"error", | |
"always" | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "stylelint-config-standard" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First run
yarn install
ornpm install
then to build sass simply runnpm run sass
, to build and watchnpm run watch:sass
and to run lintersnpm run lint
. You get the idea...