Skip to content
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

ESLint Standard #1335

Merged

Conversation

zcei
Copy link
Contributor

@zcei zcei commented Feb 5, 2018

Umbrella issue: #1333

Use a unified ESLint config instead of maintaining our own set of rules.

no-var & prefer-const has been added, so we get ESLint autofixes for free 🙂

Only the first commit needs to be reviewed, as the rest can be considered safe, as the transforms for autofixes are tested by ESLint & the community.

@Khaledgarbaya Khaledgarbaya added this to the v1.0.0 milestone Feb 5, 2018
@Khaledgarbaya Khaledgarbaya self-assigned this Feb 5, 2018
@axe312ger
Copy link
Contributor

A few manual fixes are still needed:

/home/travis/build/axios/axios/lib/adapters/http.js
   34:16  error    'new Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead  node/no-deprecated-api
   36:16  error    'new Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead  node/no-deprecated-api
  114:24  error    'new Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead  node/no-deprecated-api
  132:5   warning  Unexpected var, use let or const instead                                                                                                                no-var
/home/travis/build/axios/axios/lib/helpers/btoa.js
  19:5  warning  Unexpected var, use let or const instead  no-var
/home/travis/build/axios/axios/lib/helpers/isAbsoluteURL.js
  13:24  error  Unnecessary escape character: \+  no-useless-escape
  13:28  error  Unnecessary escape character: \.  no-useless-escape
/home/travis/build/axios/axios/lib/helpers/isURLSameOrigin.js
  47:7  error  'originURL' is never reassigned. Use 'const' instead  prefer-const
/home/travis/build/axios/axios/lib/utils.js
  218:7  error  unnecessary '.call()'  no-useless-call
  224:9  error  unnecessary '.call()'  no-useless-call
✖ 10 problems (8 errors, 2 warnings)

@zcei
Copy link
Contributor Author

zcei commented Feb 5, 2018

These are most likely to be resolved in the future PRs. This is only about auto-fixable stuff for a good foundation, as there is no manual review needed.

@@ -11,6 +11,7 @@
"browser": "NODE_ENV=production webpack",
"browser:dev": "webpack",
"build": "npm run clean && npm run cjs && npm run browser",
"lint": "eslint lib test",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have another npm script format so future contributor can use it to reformat their code before submitting a PR

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in a second thought this might pollute the changes in the PR, adding a ci step to lint would be better I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added linting to test script 🙂

@zcei zcei force-pushed the release/1.0.0-eslint-standard branch from 0f77372 to bb2d866 Compare February 5, 2018 17:15
Copy link
Collaborator

@Khaledgarbaya Khaledgarbaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@Khaledgarbaya Khaledgarbaya merged commit 30e281d into axios:release/1.0.0 Feb 5, 2018
@Khaledgarbaya Khaledgarbaya deleted the release/1.0.0-eslint-standard branch February 5, 2018 20:58
@Khaledgarbaya Khaledgarbaya mentioned this pull request Feb 5, 2018
48 tasks
@Khaledgarbaya Khaledgarbaya added this to To Do in 1.0.0 via automation Feb 9, 2018
@Khaledgarbaya Khaledgarbaya moved this from To Do to Done in 1.0.0 Feb 9, 2018
@axios axios locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
1.0.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants