Skip to content

Commit

Permalink
Port from hoist-dev-utils with updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
amcclain committed Oct 9, 2018
1 parent 93a8139 commit cc339f1
Show file tree
Hide file tree
Showing 5 changed files with 1,214 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# IDE Files
.idea
!/.idea/scopes/
!/.idea/copyright/
*.iml

# Build / Libs
node_modules/

# Logs
*.log

# OS generated files
.DS_Store
.DS_Store?
ehthumbs.db
Thumbs.db

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# eslint-config
Sharable base ESLint config for Hoist React applications
# Hoist eslint-config

A shareable set of [ESLint](https://eslint.org/) configurations with ExHI's coding conventions and best practices
for Hoist React based development.

Due to limitations of how ESLint's `extends` directive works, this needs to be built and published as its own
dedicated package. See https://eslint.org/docs/developer-guide/shareable-configs.
92 changes: 92 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
module.exports = {
plugins: ['react'],
extends: ['eslint:recommended'],

parser: 'babel-eslint',

parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
generators: true,
experimentalObjectRestSpread: true
}
},

env: {
browser: true,
commonjs: true,
es6: true,
node: true
},

rules: {
// Hoist - disabled
'eqeqeq': 0,
'no-console': 0,
'no-empty': 0,
'no-multi-spaces': 0,
'no-trailing-spaces': 0,
'no-underscore-dangle': 0,
'semi-spacing': 0,
'space-infix-ops': 0,
'space-unary-ops': 0,
'strict': 0,

// React - enabled
'react/jsx-uses-react': 2,
'react/jsx-uses-vars': 2,

// Hoist - enabled / customized
'no-unused-vars': [2, {
ignoreRestSiblings: true,
args: 'none'
}],
'array-bracket-spacing': [2, 'never'],
'consistent-this': [2, 'me'],
'comma-dangle': 2,
'comma-spacing': [2, {
before: false,
after: true
}],
'comma-style': 2,
'brace-style': [2, '1tbs', {
allowSingleLine: true
}],
'curly': [2, 'multi-line'],
'key-spacing': [2, {
beforeColon: false,
afterColon: true,
mode: 'minimum'
}],
'keyword-spacing': [2, {
before: true,
after: true
}],
'space-before-function-paren': [2, {
'anonymous': 'never',
'named': 'never',
'asyncArrow': 'always'
}],
'no-spaced-func': 2,
'space-in-parens': 2,
'space-before-blocks': 2,
'spaced-comment': [2, 'always', {
markers: ['=', 'noinspection'],
exceptions: ['-']
}],
'quotes': [2, 'single', 'avoid-escape'],
'indent': [2, 4, {
SwitchCase: 1
}],
'operator-linebreak': [2, 'after'],
'no-multiple-empty-lines': [2, {
max: 2
}],
'block-scoped-var': 2,
'semi': [2, 'always', {
omitLastInOneLineBlock: true
}]
}

};
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@xh/eslint-config",
"version": "0.2.2",
"description": "Sharable base ESLint config for Hoist React applications",
"repository": "github:exhi/eslint-config",
"homepage": "https://xh.io",
"bugs": "https://github.com/exhi/eslint-config/issues",
"author": "Extremely Heavy Industries, Inc.",
"license": "UNLICENSED",
"files": [
"index.js"
],
"dependencies": {
"babel-eslint": "~10.0.1",
"eslint": "~5.6.1",
"eslint-plugin-react": "~7.11.1"
}
}
Loading

0 comments on commit cc339f1

Please sign in to comment.