Skip to content

Commit

Permalink
Add config for linters
Browse files Browse the repository at this point in the history
* Add .editorconfig with basic whitespace settings
* Add package.json with dev dependencies for Prettier, ESLint, and
  stylelint
* Add stylelint configuration
* Add Prettier and ESLint configuration
  • Loading branch information
acdha authored and rstorey committed Jun 15, 2018
1 parent c8a0066 commit 8762a16
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See http://editorconfig.org for format details and
# http://editorconfig.org/#download for editor / IDE integration

root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab

# We don't want to apply our defaults to third-party code or minified bundles:
[**/{external,vendor}/**,**.min.{js,css}]
indent_style = ignore
indent_size = ignore
14 changes: 14 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root: true
extends: eslint:recommended
plugins:
- prettier
rules:
indent:
# https://eslint.org/docs/4.0.0/rules/indent
# Match defaults & Crockford but enable indentation for switch statement cases:
- 2
- 4
- SwitchCase: 1
env:
browser: true
es6: true
2 changes: 2 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
singleQuote: true
bracketSpacing: false
5 changes: 5 additions & 0 deletions .stylelintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends:
- stylelint-config-recommended
- stylelint-config-prettier
rules:
indentation: 4
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"devDependencies": {
"eslint": "^4.19.1",
"eslint-plugin-prettier": "^2.6.0",
"prettier": "^1.13.4",
"stylelint": "^9.2.1",
"stylelint-config-prettier": "^3.2.0",
"stylelint-config-recommended": "^2.1.0"
}
}

0 comments on commit 8762a16

Please sign in to comment.