Skip to content

Instantly share code, notes, and snippets.

@jsnanigans
Last active May 3, 2018 07:59
Show Gist options
  • Save jsnanigans/6042ab9a3443565c7b366499efc9cce5 to your computer and use it in GitHub Desktop.
Save jsnanigans/6042ab9a3443565c7b366499efc9cce5 to your computer and use it in GitHub Desktop.
LOOP: eshint, lint-scss
module.exports = {
"env": {
"browser": false,
"es6": true,
"node": true,
"mocha": true
},
"globals": {
"document": false,
"navigator": false,
"window": false,
"$": false,
"Modernizr": false,
"angular": false,
"Image": false,
"XMLSerializer": false,
"getComputedStyle": false,
"app": false,
"Gridle": false
},
"rules": {
"accessor-pairs": 2,
"arrow-spacing": [2, {
"before": true,
"after": true
}],
"block-spacing": [2, "always"],
"brace-style": [2, "1tbs", {
"allowSingleLine": true
}],
"comma-dangle": [2, "always-multiline"],
"comma-spacing": [2, {
"before": false,
"after": true
}],
"comma-style": [2, "last"],
"constructor-super": 2,
"dot-location": [2, "property"],
"eol-last": 2,
"eqeqeq": [2, "allow-null"],
"generator-star-spacing": [2, {
"before": true,
"after": true
}],
"key-spacing": [0, {
"beforeColon": true,
"afterColon": true
}],
"keyword-spacing": [2, {
"before": true,
"after": true
}],
"new-cap": [2, {
"newIsCap": true,
"capIsNew": false
}],
"new-parens": 2,
"no-array-constructor": 2,
"no-caller": 2,
"no-class-assign": 2,
"no-cond-assign": 2,
"no-const-assign": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-dupe-args": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": [2, "functions"],
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 0,
"no-multi-str": 2,
"no-multiple-empty-lines": [1, {
"max": 10
}],
"no-native-reassign": 0,
"no-negated-in-lhs": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-object": 2,
"no-new-require": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-proto": 0,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-return-assign": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-sparse-arrays": 2,
"no-this-before-super": 2,
"no-throw-literal": 2,
"no-trailing-spaces": 0,
"no-undef": 2,
"no-undef-init": 2,
"no-unexpected-multiline": 2,
"no-unneeded-ternary": [2, {
"defaultAssignment": false
}],
"no-unreachable": 2,
"no-unused-vars": [1, {
"vars": "all",
"args": "none"
}],
"no-useless-call": 0,
"no-with": 2,
"one-var": [0, {
"initialized": "never"
}],
"operator-linebreak": [0, "after", {
"overrides": {
"?": "before",
":": "before"
}
}],
"padded-blocks": [0, "never"],
"quotes": [2, "single", "avoid-escape"],
"radix": 2,
"semi": [0, "always"],
"semi-spacing": [2, {
"before": false,
"after": true
}],
"space-before-blocks": [1, "always"],
"space-before-function-paren": [1, "never"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [2, {
"words": true,
"nonwords": false
}],
"spaced-comment": [0, "always", {
"markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","]
}],
"use-isnan": 2,
"valid-typeof": 2,
"wrap-iife": [2, "any"],
"yoda": [2, "never"]
}
};
# sass-lint config generated by make-sass-lint-config v0.1.2
#
# The following scss-lint Linters are not yet supported by sass-lint:
# DisableLinterReason, ElsePlacement, PropertyCount, SelectorDepth
# SpaceAroundOperator, TrailingWhitespace, UnnecessaryParentReference, Compass::*
#
# The following settings/values are unsupported by sass-lint:
# Linter Indentation, option "allow_non_nested_indentation"
# Linter Indentation, option "character"
# Linter NestingDepth, option "ignore_parent_selectors"
# Linter PropertySortOrder, option "min_properties"
# Linter PropertySortOrder, option "separate_groups"
# Linter SpaceBeforeBrace, option "allow_single_line_padding"
# Linter VendorPrefix, option "identifier_list"
files:
include: '**/*.scss'
options:
formatter: stylish
merge-default-rules: false
rules:
bem-depth:
- 0
- max-depth: 1
border-zero:
- 1
- convention: zero
brace-style:
- 1
- allow-single-line: true
class-name-format:
- 1
- convention: hyphenatedlowercase
clean-import-paths:
- 1
- filename-extension: false
leading-underscore: false
empty-line-between-blocks:
- 0
- ignore-single-line-rulesets: true
extends-before-declarations: 1
extends-before-mixins: 1
final-newline:
- 1
- include: true
force-attribute-nesting: 1
force-element-nesting: 1
force-pseudo-nesting: 1
function-name-format:
- 1
- allow-leading-underscore: true
convention: hyphenatedlowercase
hex-length:
- 1
- style: short
hex-notation:
- 1
- style: lowercase
id-name-format:
- 1
- convention: hyphenatedlowercase
indentation:
- 0
- size: 2
leading-zero:
- 1
- include: false
mixin-name-format:
- 1
- allow-leading-underscore: true
convention: hyphenatedlowercase
mixins-before-declarations: 1
nesting-depth:
- 0
- max-depth: 3
no-color-keywords: 1
no-color-literals: 0
no-css-comments: 1
no-debug: 1
no-duplicate-properties: 1
no-empty-rulesets: 1
no-extends: 0
no-ids: 1
no-important: 1
no-invalid-hex: 1
no-mergeable-selectors: 1
no-misspelled-properties:
- 1
- extra-properties: []
no-qualifying-elements:
- 1
- allow-element-with-attribute: false
allow-element-with-class: false
allow-element-with-id: false
no-trailing-zero: 1
no-transition-all: 0
no-url-protocols: 1
no-vendor-prefixes:
- 1
- additional-identifiers: []
excluded-identifiers: []
placeholder-in-extend: 1
placeholder-name-format:
- 1
- convention: hyphenatedlowercase
property-sort-order:
- 1
- ignore-custom-properties: false
property-units:
- 1
- global:
- ch
- em
- ex
- rem
- cm
- in
- mm
- pc
- pt
- px
- q
- vh
- vw
- vmin
- vmax
- deg
- grad
- rad
- turn
- ms
- s
- Hz
- kHz
- dpi
- dpcm
- dppx
- '%'
per-property: {}
quotes:
- 1
- style: single
shorthand-values:
- 1
- allowed-shorthands:
- 1
- 2
- 3
single-line-per-selector: 1
space-after-bang:
- 1
- include: false
space-after-colon:
- 1
- include: true
space-after-comma:
- 1
- include: true
space-before-bang:
- 1
- include: true
space-before-brace:
- 0
- include: true
space-before-colon: 1
space-between-parens:
- 1
- include: false
trailing-semicolon: 1
url-quotes: 1
variable-for-property:
- 0
- properties: []
variable-name-format:
- 1
- allow-leading-underscore: true
convention: hyphenatedlowercase
zero-unit: 1
Setup:
install npm modules:
$ npm install -g eslint sass-lint
for SublimeText:
install the packages:
- SublimeLinter
- SublimeLinter-contrib-sass-lint
- SublimeLinter-contrib-eslint
for Atom:
intall the packages:
- linter-eslint
- linter-sass-lint
In your project directory add there two files (crete files, copy content):
.eslintrc.js : https://gist.githubusercontent.com/jsnanigans/6042ab9a3443565c7b366499efc9cce5/raw/59f131ee11691969471828c02c0dfa1f4bf1033c/.eslintrc.js
.sass-lint.yml : https://gist.githubusercontent.com/jsnanigans/6042ab9a3443565c7b366499efc9cce5/raw/59f131ee11691969471828c02c0dfa1f4bf1033c/.sass-lint.yml
Optional:
To 'fix' the files file automatically:
for SublimeText:
JavaScript
- install package: ESLint-Formatter
- add {"format_on_save": true} to your user settings if you want it to run every time you save.
for Atom:
JavaScript
- ctrl+shift+p and find "Linter Eslint: Fix File"
SCSS
- install package: atom-beautify
- configure the atom-beautify > scss settings as you wish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment