-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce code linting #1024
Open
expelledboy
wants to merge
8
commits into
amark:master
Choose a base branch
from
expelledboy:code-linting
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Introduce code linting #1024
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2eeee60
Introduce eslint with custom config per major directory
expelledboy 6e83dd7
Explicitly add linebreak-style but ignore offending files
expelledboy cffac00
Disable even more linting rules to accept codebase
expelledboy 6ee2cae
Apparently husky auto git adds now
expelledboy db545d6
Add coverage report tests at 65%
expelledboy 6026a58
Merge upstream changes
expelledboy 297dc85
Merge branch 'master' into code-linting
expelledboy ef3eb07
Fix linting issues introduced by lib/wave.js changes
expelledboy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = false | ||
trim_trailing_whitespace = false | ||
|
||
[*.{js}] | ||
insert_final_newline = false | ||
trim_trailing_whitespace = false | ||
indent_style = tab | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
test/sea/sea_old.js | ||
test/mocha.js | ||
test/expect.js | ||
test/json2.js | ||
test/ptsd/* | ||
test/tmp/* | ||
|
||
# only because of CRLF | ||
lib/jsonp.js | ||
lib/wsp.js | ||
lib/http.js | ||
lib/aws.js | ||
test/common.js | ||
test/old/shotgun.js | ||
test/old/server.js | ||
test/old/interface.js | ||
test/bug/686.js | ||
test/old/interface.js | ||
test/old/shoot.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
node_modules | ||
npm-debug.log | ||
yarn.lock | ||
*data.json | ||
*data* | ||
*.db | ||
.idea/ | ||
*.bak | ||
*.new | ||
*.log | ||
v8.json | ||
*.DS_store | ||
isolate*.log | ||
.esm-cache | ||
.sessionStorage | ||
.localStorage | ||
/types/**/*.ts | ||
!/types/**/*.d.ts | ||
/gun.ts | ||
/temp/ | ||
node_modules | ||
npm-debug.log | ||
yarn.lock | ||
*data.json | ||
*data* | ||
*.db | ||
.idea/ | ||
*.bak | ||
*.new | ||
*.log | ||
v8.json | ||
*.DS_store | ||
isolate*.log | ||
.esm-cache | ||
.sessionStorage | ||
.localStorage | ||
/types/**/*.ts | ||
!/types/**/*.d.ts | ||
/gun.ts | ||
/temp/ | ||
.nyc_output/ | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,271 @@ | ||
# Carefully curated | ||
# https://eslint.org/docs/rules/ | ||
|
||
env: { es6: true, node: true, browser: true } | ||
parserOptions: { ecmaVersion: 2018 } | ||
|
||
rules: | ||
# ==> Possible Errors | ||
for-direction: error | ||
getter-return: error | ||
# no-async-promise-executor: error | ||
no-await-in-loop: error | ||
no-compare-neg-zero: error | ||
# no-cond-assign: error | ||
no-console: 0 | ||
# no-constant-condition: error | ||
no-control-regex: error | ||
no-debugger: error | ||
no-dupe-args: error | ||
no-dupe-else-if: error | ||
no-dupe-keys: error | ||
no-duplicate-case: error | ||
# no-empty: error | ||
no-empty-character-class: error | ||
no-ex-assign: error | ||
no-extra-boolean-cast: error | ||
# no-extra-parens: error | ||
# no-extra-semi: error | ||
no-func-assign: error | ||
no-import-assign: error | ||
# no-inner-declarations: error | ||
no-invalid-regexp: error | ||
no-irregular-whitespace: error | ||
no-loss-of-precision: error | ||
no-misleading-character-class: error | ||
no-obj-calls: error | ||
no-promise-executor-return: error | ||
# no-prototype-builtins: error | ||
no-regex-spaces: error | ||
no-setter-return: error | ||
no-sparse-arrays: error | ||
no-template-curly-in-string: error | ||
no-unexpected-multiline: error | ||
# no-unreachable: error | ||
no-unreachable-loop: error | ||
no-unsafe-finally: error | ||
no-unsafe-negation: error | ||
no-useless-backreference: error | ||
# require-atomic-updates: error | ||
use-isnan: error | ||
valid-typeof: error | ||
# ==> Best Practices | ||
accessor-pairs: error | ||
# array-callback-return: error | ||
# block-scoped-var: error | ||
class-methods-use-this: error | ||
# complexity: [error, 3] | ||
# consistent-return: [error, { treatUndefinedAsUnspecified: true }] | ||
# curly: error | ||
# default-case: error | ||
default-case-last: error | ||
default-param-last: error | ||
# dot-location: [ error, object ] | ||
# dot-notation: error | ||
# eqeqeq: [ error, smart ] | ||
grouped-accessor-pairs: error | ||
# guard-for-in: error | ||
max-classes-per-file: error | ||
no-alert: error | ||
no-caller: error | ||
no-case-declarations: error | ||
no-constructor-return: error | ||
no-div-regex: error | ||
# no-else-return: error | ||
# no-empty-function: error | ||
no-empty-pattern: error | ||
# no-eq-null: error | ||
# no-eval: error | ||
no-extra-bind: error | ||
no-extra-label: error | ||
no-fallthrough: error | ||
no-floating-decimal: error | ||
no-global-assign: error | ||
# no-implicit-coercion: error | ||
# no-implicit-globals: error | ||
no-implied-eval: error | ||
no-invalid-this: error | ||
no-iterator: error | ||
no-labels: error | ||
no-lone-blocks: error | ||
# no-loop-func: error | ||
# no-magic-numbers: error | ||
# no-multi-spaces: error | ||
no-multi-str: error | ||
no-new: error | ||
no-new-func: error | ||
no-new-wrappers: error | ||
no-octal: error | ||
no-octal-escape: error | ||
# no-param-reassign: error | ||
no-proto: error | ||
# no-redeclare: error | ||
no-restricted-properties: 0 | ||
# no-return-assign: error | ||
no-return-await: error | ||
no-script-url: error | ||
no-self-assign: error | ||
no-self-compare: error | ||
# no-sequences: error | ||
# no-throw-literal: error | ||
no-unmodified-loop-condition: error | ||
# no-unused-expressions: error | ||
no-unused-labels: error | ||
no-useless-call: error | ||
no-useless-catch: error | ||
no-useless-concat: error | ||
# no-useless-escape: error | ||
# no-useless-return: error | ||
# no-void: error | ||
no-warning-comments: 0 | ||
no-with: error | ||
prefer-named-capture-group: error | ||
# prefer-promise-reject-errors: error | ||
prefer-regex-literals: error | ||
radix: error | ||
# require-await: error | ||
require-unicode-regexp: 0 | ||
# vars-on-top: error | ||
wrap-iife: [error, outside] | ||
# yoda: error | ||
# ==> Strict Mode | ||
strict: 0 | ||
# ==> Variables | ||
# init-declarations: error | ||
no-delete-var: error | ||
no-label-var: error | ||
no-restricted-globals: error | ||
# no-shadow: error | ||
no-shadow-restricted-names: error | ||
# no-undef: error | ||
no-undef-init: error | ||
# no-undefined: error | ||
# no-unused-vars: error | ||
# no-use-before-define: error | ||
# ==> Stylistic Issues | ||
# array-bracket-newline: error | ||
array-bracket-spacing: error | ||
# array-element-newline: error | ||
# block-spacing: error | ||
# brace-style: error | ||
# camelcase: error | ||
# capitalized-comments: error | ||
# comma-dangle: error | ||
# comma-spacing: error | ||
# comma-style: error | ||
computed-property-spacing: error | ||
# consistent-this: error | ||
# eol-last: error | ||
func-call-spacing: error | ||
# func-name-matching: error | ||
# func-names: error | ||
# func-style: error | ||
# function-call-argument-newline: error | ||
# function-paren-newline: error | ||
id-denylist: error | ||
# id-length: error | ||
id-match: error | ||
implicit-arrow-linebreak: error | ||
# indent: error << okay wow | ||
jsx-quotes: error | ||
# key-spacing: error | ||
# keyword-spacing: error | ||
# line-comment-position: error | ||
linebreak-style: error | ||
# lines-around-comment: error | ||
lines-between-class-members: error | ||
# max-depth: error | ||
# max-len: error | ||
# max-lines: error | ||
# max-lines-per-function: error | ||
max-nested-callbacks: error | ||
# max-params: error | ||
# max-statements: error | ||
# max-statements-per-line: error | ||
# multiline-comment-style: error | ||
# multiline-ternary: error | ||
# new-cap: error | ||
# new-parens: error | ||
# newline-per-chained-call: error | ||
no-array-constructor: error | ||
# no-bitwise: error | ||
# no-continue: error | ||
# no-inline-comments: error | ||
# no-lonely-if: error | ||
# no-mixed-operators: error | ||
# no-mixed-spaces-and-tabs: error | ||
# no-multi-assign: error | ||
# no-multiple-empty-lines: error | ||
# no-negated-condition: error | ||
# no-nested-ternary: error | ||
no-new-object: error | ||
# no-plusplus: error | ||
no-restricted-syntax: error | ||
# no-tabs: error | ||
# no-ternary: error | ||
# no-trailing-spaces: error | ||
# no-underscore-dangle: error | ||
no-unneeded-ternary: error | ||
no-whitespace-before-property: error | ||
# nonblock-statement-body-position: error | ||
# object-curly-newline: error | ||
# object-curly-spacing: error | ||
# object-property-newline: error | ||
# one-var: error | ||
# one-var-declaration-per-line: error | ||
# operator-assignment: error | ||
# operator-linebreak: error | ||
# padded-blocks: error | ||
padding-line-between-statements: error | ||
prefer-exponentiation-operator: error | ||
# prefer-object-spread: error | ||
# quote-props: error | ||
# quotes: error | ||
# semi: error | ||
# semi-spacing: error | ||
# semi-style: error | ||
# sort-keys: error | ||
# sort-vars: error | ||
# space-before-blocks: error | ||
# space-before-function-paren: error | ||
# space-in-parens: error | ||
# space-infix-ops: error | ||
# space-unary-ops: error | ||
# spaced-comment: error | ||
switch-colon-spacing: error | ||
template-tag-spacing: error | ||
unicode-bom: error | ||
wrap-regex: error | ||
# ==> ECMAScript 6 | ||
# arrow-body-style: error | ||
# arrow-parens: error | ||
# arrow-spacing: error | ||
constructor-super: error | ||
generator-star-spacing: error | ||
no-class-assign: error | ||
# no-confusing-arrow: error | ||
no-const-assign: error | ||
no-dupe-class-members: error | ||
no-duplicate-imports: error | ||
no-new-symbol: error | ||
no-restricted-exports: error | ||
no-restricted-imports: error | ||
no-this-before-super: error | ||
no-useless-computed-key: error | ||
no-useless-constructor: error | ||
no-useless-rename: error | ||
# no-var: error | ||
# object-shorthand: error | ||
# prefer-arrow-callback: error | ||
# prefer-const: error | ||
# prefer-destructuring: error | ||
prefer-numeric-literals: error | ||
# prefer-rest-params: error | ||
prefer-spread: error | ||
# prefer-template: error | ||
require-yield: error | ||
rest-spread-spacing: error | ||
sort-imports: error | ||
# symbol-description: error | ||
template-curly-spacing: error | ||
yield-star-spacing: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This btw is a prefect example of why you need linting. This file clearly had CRLF line breaks, and because I added 1 small change at the end my editor detected inconsistencies and normalized it. The
.eslintignore
file actually has a list of such files in the *.js realm which fail to be consistent with the rest of the project.