Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Assorted lint tweaks #2903

Closed
wants to merge 2 commits into from
Closed

Assorted lint tweaks #2903

wants to merge 2 commits into from

Conversation

XhmikosR
Copy link
Contributor

@XhmikosR XhmikosR commented Apr 25, 2020

  • remove useless conditional in bin/node-sass; sourceMapIsDirectory always evaluates to true
  • remove unneeded else blocks
  • remove lonely if blocks
  • remove useless escape characters from regular expressions
  • disable use of Object.prototypes builtins directly
  • throw a TypeError instead of a generic Error when the options isn't an Object
  • specify explicitly 10 as the radix for parseInt
  • remove the path segments from require statements
  • remove spaces before function parentheses for consistency
  • replace the package reserved keyword in test/api.js with pkg
  • enforce end of file newlines
  • disallow yoda expressions
  • sort the ESLint rules by name so that it's easier to find a rule
  • lint all the files for consistency

Let me know if you need me to make any changes 🙂

PS. I only tested this on GitHub Actions CI on my fork.
PPS. If Node.js 6.x is the minimum supported version, I guess we could use more ES6 features. EDIT: Just saw the Travis matrix.

* remove useless conditional in bin/node-sass; `sourceMapIsDirectory` always evaluates to true
* remove unneeded else blocks
* remove lonely if blocks
* remove useless escape characters from regular expressions
* disable use of Object.prototypes builtins directly
* throw a `TypeError` instead of a generic `Error` when the options isn't an Object
* specify explicitly 10 as the radix for `parseInt`
* remove the path segments from require statements
* remove spaces before function parentheses for consistency
* replace the `package` reserved keyword in test/api.js with `pkg`
* enforce end of file newlines
* disallow yoda expressions
* sort the ESLint rules by name so that it's easier to find a rule
* lint all the files for consistency
@XhmikosR
Copy link
Contributor Author

It seems tests fail on Node.js 0.10 and 0.12. I will try to pinpoint why and revert the related changes.

@nschonni
Copy link
Contributor

Please submit the changes separately

@XhmikosR
Copy link
Contributor Author

NVM then.

@XhmikosR XhmikosR closed this Apr 25, 2020
@XhmikosR XhmikosR deleted the lint branch April 25, 2020 16:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants