Skip to content

Commit

Permalink
Rules
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaredWilcurt committed Sep 23, 2019
1 parent 18de1be commit b04c890
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 62 deletions.
62 changes: 1 addition & 61 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,61 +1 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
node_modules
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# eslint-config-tjw-base
# eslint-config-tjw-base

The Jared Wilcurt's base ESLint rules


## Using this

1. `npm install --save-dev eslint-config-tjw-base`
1. In your `.eslitrc.js` add `tjw-base` to your `extends` like so:
```js
module.exports = {
'extends': [
'tjw-base'
]
};
```
110 changes: 110 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// JS
module.exports = {
'parserOptions': {
'sourceType': 'module'
},
'env': {
'browser': true,
'node': true
},
'rules': {
'arrow-parens': [
'off'
],
'brace-style': [
'error',
'1tbs',
{
'allowSingleLine': true
}
],
'comma-dangle': [
'error',
'never'
],
'comma-spacing': [
'error',
{
'before': false,
'after': true
}
],
'comma-style': [
'error',
'last'
],
'curly': [
'error'
],
// allow async-await
'generator-star-spacing': [
'off'
],
// 2 space indentation (should match .editorconfig)
'indent': [
'error',
2,
{
'SwitchCase': 1
}
],
'keyword-spacing': [
'error',
{
'before': true,
'after': true
}
],
// allow debugger during development
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-multi-spaces': [
'error'
],
'no-unused-vars': [
'error'
],
'no-undef': [
'error'
],
// Only allow let and const, no var
'no-var': [
'error'
],
'object-curly-spacing': [
'error',
'always'
],
'one-var': [
'error',
'never'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
],
'space-before-blocks': [
'error',
'always'
],
'space-before-function-paren': [
'error',
'always'
],
'space-in-parens': [
'error',
'never'
],
'space-infix-ops': [
'error'
],
'spaced-comment': [
'error',
'always'
]
}
};
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "eslint-config-tjw-base",
"version": "1.0.0",
"main": "index.js",
"description": "The Jared Wilcurt's base linting rules",
"author": "The Jared Wilcurt",
"keywords": [
"tjw",
"eslint",
"lint"
],
"repository": {
"type": "git",
"url": "git+https://github.com/tjw-lint/eslint-config-tjw-base.git"
},
"homepage": "https://github.com/tjw-lint/eslint-config-tjw-base#readme",
"license": "MIT",
"bugs": {
"url": "https://github.com/tjw-lint/eslint-config-tjw-base/issues"
}
}

0 comments on commit b04c890

Please sign in to comment.