Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Linter configurations for Stolley's classes (ITMD 361, COM 330/530).
{
"settings": {
"_version": "Stolley House Config, v. 1.0.1, 20171025",
"_eslint_version": "4.9.0",
"_rules_url": "https://eslint.org/docs/rules/"
},
"root": true,
"env": {
"browser": true,
"jquery": true
},
"extends": "eslint:recommended",
"rules": {
"no-console": "off",
"block-scoped-var": "warn",
"curly": ["error", "all"],
"default-case": "warn",
"eqeqeq": "error",
"no-alert": "warn",
"no-implicit-globals": "warn",
"vars-on-top": 1,
"yoda": "error",
"no-undefined": "error",
"comma-dangle": ["error", "never"],
"comma-spacing": ["error", { "before": false, "after": true }],
"func-call-spacing": "warn",
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"multiline-comment-style": ["warn", "separate-lines"],
"spaced-comment": ["warn", "always"],
"semi": ["warn", "always"],
"semi-spacing": ["error", {"before": false, "after": true}]
}
}
{
"settings": {
"_version": "Stolley House Config, v. 1.0.1, 20171025",
"_eslint_version": "4.9.0",
"_rules_url": "https://eslint.org/docs/rules/"
},
"root": true, // don't look further up the directory tree for any more eslint rules
"env": {
"browser": true, // for browser testing
"jquery": true // with jQuery, if used
},
"extends": "eslint:recommended", // load basic eslint rules
"rules": {
// Deviations from eslint:recommended
"no-console": "off", // allow use of console calls
// Best Practices
"block-scoped-var": "warn", // scope variables to blocks
"curly": ["error", "all"], // always use curly braces around blocks
"default-case": "warn", // require default cases in switch statements
"eqeqeq": "error", // always test for type, !== and ===
"no-alert": "warn", // no annoying pop-up boxes
"no-implicit-globals": "warn", // warn about global variables
"vars-on-top": 1, // declare variables at the top of function scope
"yoda": "error", // disallow Yoda conditions
// Variables
"no-undefined": "error", // disallow undefined as an identifier
// Stylistic Issues
"comma-dangle": ["error", "never"], // no trailing commas
"comma-spacing": ["error", { "before": false, "after": true }], // spaces after commas
"func-call-spacing": "warn", // no spaces between function name and parentheses
"indent": ["error", 2], // indent by two spaces
"linebreak-style": ["error", "unix"], // Unix-style line endings
"multiline-comment-style": ["warn", "separate-lines"], // double-slash style comments
"spaced-comment": ["warn", "always"], // spaces after double-slash comment markers
"semi": ["warn", "always"], // always require semicolons after statements
"semi-spacing": ["error", {"before": false, "after": true}] // spaces after semicolons
}
}
{
// Stolley House Config, v. 1.1.1, 20170923
// names of npm modules to load into htmllint
"plugins": [],
// Configuration options:
"attr-bans": ["align", "background", "bgcolor", "border", "frameborder", "longdesc", "marginwidth", "marginheight", "scrolling", "style", "target", "width", "height", "onload", "onclick"], // ban deprecated/obsolete attributes
"attr-name-style": "dash", // allow hyphens/dashes in attributes, e.g., for data- attributes
"attr-no-dup": true, // no duplicate attributes
"attr-validate": true, // well-formed attribute style
"class-no-dup": true, // no duplicate classes on same element
"doctype-first": true, // <!DOCTYPE html> must be first line
"fig-require-figcaption": true, // require <figcaption>
"html-req-lang": true, // <html> tag must have lang attribute
"head-req-title": true, // All documents must have <title>
"head-valid-content-model": true, // Only valid <head> children
"id-class-style": "dash", // allow hyphens/dashes in attribute values, e.g., week-one
"id-no-dup": true, // no duplicate IDs anywhere on page
"img-req-alt": true, // All <img> tags must have non-empty alt attribute
"indent-style": "spaces", // use spaces to indent
"indent-width": 2, // use two spaces, to be precise
"input-req-label": true, // All <input> tags must have a <label> tag
"label-req-for": true, // All <label> tags must have a for attribute
"line-end-style": "lf", // Unix-style LF line-endings
"spec-char-escape": true, // XML special characters (<,>,&,etc.) must be escaped
"tag-bans": ["style", "iframe", "br", "hr"], // no on-pages styles (for now), no iframes, breaks, horizontal rules
"tag-close": true, // tags that open must close
"tag-name-lowercase": true, // only lowercase for tag names
"tag-name-match": true, // tag names must match, in both name and case
"tag-self-close": "always" // tags like <meta> must self-close: <meta />
}
{
# Stolley House Config, v. 1.1.0, 20170920
"rules": {
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always",
"at-rule-semicolon-newline-after": "always",
"block-closing-brace-newline-before": "always-multi-line",
"block-closing-brace-space-before": "always-single-line",
"block-no-empty": true,
"block-opening-brace-newline-after": "always-multi-line",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"declaration-block-no-duplicate-properties": true,
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-single-line-max-declarations": 1,
"declaration-block-trailing-semicolon": "always",
"declaration-colon-space-after": "always",
"declaration-colon-space-before": "never",
"declaration-no-important": true,
"font-family-name-quotes": "always-where-recommended",
"indentation": 2,
"length-zero-no-unit": true,
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-name-case": "lower",
"no-descending-specificity": true,
"no-duplicate-selectors": true,
"no-eol-whitespace": true,
"no-invalid-double-slash-comments": true,
"no-missing-end-of-source-newline": true,
"number-leading-zero": "always",
"number-no-trailing-zeros": true,
"property-case": "lower",
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-quotes": "always",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-list-comma-newline-after": "always-multi-line",
"selector-list-comma-space-after": "always-single-line",
"selector-pseudo-class-case": "lower",
"selector-type-case": "lower",
"string-quotes": "double",
"unit-blacklist": ["px", "pt", "in", "cm", "mm"],
"unit-case": "lower",
"unit-no-unknown": true,
"value-keyword-case": "lower",
"value-list-comma-space-after": "always"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment