-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This switches us from JSHint to ESLint, improving the quality and consistency of our code. (We also use ESLint elsewhere at Airtable.) To break down this change: * We made several cleanups before this commit to ease the transition. See [#95][1], [#96][2], [#97][3], [#98][4], [#99][5], [#101][6] (and a fix in [#107][7]), [#105][8], [#109][9], [#118][10], [#119][11], [#120][12] * Installed `eslint` * Add `.eslintrc.json` and `.eslintignore` (and a slightly-different `.eslintrc.json` in `test`) * Remove JSHint. Involved uninstalling the package, removing it from the gruntfile, and removing `jshint ignore`s. * Update the `lint` task in `package.json` * Update `return` into `return void 0` for consistent returns in `callbackToPromise` * Add one `// eslint-disable-line` comment in a single test file * Run `eslint --fix .`, automatically fixing all of the remaining warnings and errors [1]: #95 [2]: #96 [3]: #97 [4]: #98 [5]: #99 [6]: #101 [7]: #107 [8]: #105 [9]: #109 [10]: #118 [11]: #119 [12]: #120
- Loading branch information
Evan Hahn
committed
Jul 9, 2019
1 parent
0621f51
commit 9861673
Showing
23 changed files
with
1,214 additions
and
779 deletions.
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,3 @@ | ||
/node_modules/ | ||
/build/airtable.browser.js | ||
/test/test_files/airtable.browser.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 |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"globals": { | ||
"Promise": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended" | ||
], | ||
"rules": { | ||
"no-case-declarations": "warn", | ||
"no-debugger": "warn", | ||
"no-empty": "warn", | ||
"no-extra-boolean-cast": "warn", | ||
"no-extra-semi": "warn", | ||
"no-redeclare": "warn", | ||
"no-regex-spaces": "warn", | ||
"no-self-assign": "warn", | ||
"no-sparse-arrays": "warn", | ||
"no-unreachable": "warn", | ||
"no-console": "off", | ||
"require-yield": "off", | ||
"array-bracket-spacing": "warn", | ||
"array-callback-return": "error", | ||
"arrow-spacing": "warn", | ||
"block-scoped-var": "error", | ||
"block-spacing": "warn", | ||
"comma-spacing": "warn", | ||
"comma-style": "warn", | ||
"computed-property-spacing": "warn", | ||
"consistent-return": "error", | ||
"consistent-this": ["warn", "that"], | ||
"curly": "warn", | ||
"default-case": "warn", | ||
"dot-notation": ["warn", {"allowPattern": "[$_0-9]"}], | ||
"eqeqeq": "error", | ||
"func-call-spacing": "error", | ||
"guard-for-in": "error", | ||
"handle-callback-err": "error", | ||
"key-spacing": "warn", | ||
"keyword-spacing": "warn", | ||
"linebreak-style": "warn", | ||
"indent": ["warn", 4], | ||
"new-parens": "warn", | ||
"no-array-constructor": "error", | ||
"no-caller": "error", | ||
"no-catch-shadow": "error", | ||
"no-confusing-arrow": "warn", | ||
"no-constant-condition": "warn", | ||
"no-div-regex": "warn", | ||
"no-eq-null": "error", | ||
"no-eval": "error", | ||
"no-extend-native": "error", | ||
"no-extra-bind": "warn", | ||
"no-extra-label": "error", | ||
"no-floating-decimal": "warn", | ||
"no-global-assign": "warn", | ||
"no-implicit-globals": "warn", | ||
"no-implied-eval": "error", | ||
"no-iterator": "error", | ||
"no-labels": "error", | ||
"no-label-var": "error", | ||
"no-loop-func": "error", | ||
"no-lone-blocks": "error", | ||
"no-native-reassign": "error", | ||
"no-mixed-operators": ["warn", {"groups": [["&&", "||"]]}], | ||
"no-mixed-requires": "error", | ||
"no-multi-spaces": "warn", | ||
"no-multi-str": "warn", | ||
"no-new-object": "warn", | ||
"no-new-require": "error", | ||
"no-new-wrappers": "warn", | ||
"no-octal-escape": "error", | ||
"no-path-concat": "error", | ||
"no-proto": "error", | ||
"no-script-url": "error", | ||
"no-sequences": "error", | ||
"no-self-compare": "error", | ||
"no-shadow": "error", | ||
"no-shadow-restricted-names": "error", | ||
"no-spaced-func": "warn", | ||
"no-template-curly-in-string": "error", | ||
"no-throw-literal": "warn", | ||
"no-undef": "error", | ||
"no-undef-init": "warn", | ||
"no-unneeded-ternary": "warn", | ||
"no-unsafe-negation": "warn", | ||
"no-unused-expressions": "error", | ||
"no-unused-vars": "warn", | ||
"no-useless-call": "warn", | ||
"no-useless-computed-key": "warn", | ||
"no-useless-concat": "warn", | ||
"no-useless-constructor": "warn", | ||
"no-undefined": "error", | ||
"no-whitespace-before-property": "warn", | ||
"no-with": "error", | ||
"object-curly-spacing": "warn", | ||
"one-var-declaration-per-line": "warn", | ||
"quotes": ["warn", "single", "avoid-escape"], | ||
"radix": "error", | ||
"semi": "warn", | ||
"semi-spacing": "warn", | ||
"space-before-blocks": "warn", | ||
"space-before-function-paren": [ | ||
"warn", | ||
{"anonymous": "never", "named": "never", "asyncArrow": "always"} | ||
], | ||
"space-in-parens": "warn", | ||
"space-unary-ops": "warn", | ||
"spaced-comment": "warn", | ||
"yoda": "warn" | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// jshint ignore: start | ||
/* eslint-disable */ | ||
|
||
/* Simple JavaScript Inheritance | ||
* By John Resig http://ejohn.org/ | ||
|
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.