From Organic Design
Jump to: navigation, search

Linting is a way to ensure your code follows convention.
There is a package for the text editor atom ( that intergrates linting, the package is called: "linter-eslint"
The linting config file is stored as ".eslintrc.js"
Here are the dependencies needed for linting vue:

npm i -D babel-eslint eslint eslint-config-standard eslint-plugin-html eslint-plugin-import eslint-plugin-node eslint-plugin-promise eslint-plugin-standard

Here is the rule set I like to use:

module.exports = {
	root: true,
	parser: "babel-eslint",
	parserOptions: {
		sourceType: "module"
	env: {
		browser: true,
	extends: "standard",
	// required to lint *.vue files
	plugins: [
	"rules": {
		// disallow single quotes
		"quotes": ["error", "double"],
		// force semi-colons
		"semi": ["error", "always"],
		// allow tabs
		"no-tabs": [0],
		// use tab indentation
		"indent": ["error", "tab"],
		// allow paren-less arrow functions
		"arrow-parens": 0,
		// allow async-await
		"generator-star-spacing": 0,
		// allow debugger during development
		"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0