Skip to content

Commit

Permalink
Merge branch 'angus-c:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
EvandroLG authored Jan 15, 2023
2 parents 978f6e0 + a4641cf commit f73c527
Show file tree
Hide file tree
Showing 393 changed files with 26,877 additions and 2,320 deletions.
103 changes: 26 additions & 77 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
},
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
"sourceType": "module"
},
"overrides": [
{
"files": ["**/*.ts"],
"parser": "@typescript-eslint/parser"
}
],
"rules": {
"block-scoped-var": 0,
"brace-style": [
Expand Down Expand Up @@ -35,34 +41,19 @@
"after": true
}
],
"comma-style": [
2,
"last"
],
"comma-style": [2, "last"],
"complexity": 0,
"consistent-return": 0,
"consistent-this": 0,
"curly": [
0,
"multi-line"
],
"curly": [0, "multi-line"],
"default-case": 0,
"dot-notation": 0,
"eol-last": 2,
"eqeqeq": 0,
"generator-star-spacing": [
2,
"after"
],
"generator-star-spacing": [2, "after"],
"guard-for-in": 0,
"handle-callback-err": [
2,
"^(err|error|anySpecificError)$"
],
"indent": [
2,
2
],
"handle-callback-err": [2, "^(err|error|anySpecificError)$"],
"indent": [2, 2],
"key-spacing": [
2,
{
Expand All @@ -71,11 +62,7 @@
}
],
"max-depth": 0,
"max-len": [
2,
100,
4
],
"max-len": [2, 100, 4],
"max-nested-callbacks": 0,
"max-params": 0,
"max-statements": 0,
Expand Down Expand Up @@ -117,10 +104,7 @@
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inline-comments": 0,
"no-inner-declarations": [
2,
"functions"
],
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-iterator": 2,
Expand All @@ -129,14 +113,8 @@
"no-lone-blocks": 0,
"no-lonely-if": 0,
"no-loop-func": 0,
"no-mixed-requires": [
0,
false
],
"no-mixed-spaces-and-tabs": [
2,
false
],
"no-mixed-requires": [0, false],
"no-mixed-spaces-and-tabs": [2, false],
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [
Expand Down Expand Up @@ -190,50 +168,24 @@
"no-warning-comments": [
0,
{
"terms": [
"todo",
"fixme",
"xxx"
],
"terms": ["todo", "fixme", "xxx"],
"location": "start"
}
],
"no-with": 0,
"one-var": 0,
"operator-assignment": [
0,
"always"
],
"padded-blocks": [
2,
"never"
],
"operator-assignment": [0, "always"],
"padded-blocks": [2, "never"],
"quote-props": 0,
"quotes": [
2,
"single",
"avoid-escape"
],
"quotes": [2, "single", "avoid-escape"],
"radix": 0,
"semi": 1,
"semi-spacing": 0,
"sort-vars": 0,
"space-before-blocks": [
2,
"always"
],
"space-before-function-paren": [
2,
"never"
],
"object-curly-spacing": [
2,
"never"
],
"space-in-parens": [
2,
"never"
],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"object-curly-spacing": [2, "never"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [
2,
Expand All @@ -248,11 +200,8 @@
"valid-jsdoc": 0,
"valid-typeof": 2,
"vars-on-top": 0,
"wrap-iife": [
0,
"outside"
],
"wrap-iife": [0, "outside"],
"wrap-regex": 0,
"yoda": 0
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand Down
20 changes: 11 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@

# Guidelines
* Modules must not depend on any other npm modules (inlcuding other just modules)
* Modules must not depend on any other npm modules (including other just modules)
* Always assume Just modules will be used in hot code and code accordingly
* Write in ES5
* Write in ES5 when possible. If you have to support user argument which have ES5+ types (e.g. Set and Map) you may upgrade to newer syntax (within our stated [platform support levels](https://github.com/angus-c/just#browser-support-computer)) but please bump the major version to protect legacy users.
* Favor `for` loops over high order functions
* Don't repeatedly access the same property, assign it to a `var`
* Brevity
* A lot of people choose Just utilities to minimize their app's JS footprint in memory/network constrained environments
* Keep it brief and don't add redundant code. Most utilites should fit into one shortish function.
* Keep it brief and don't add redundant code. Most utilities should fit into one shortish function.
* API
* Keep the API simple and intuitive
* Avoid multiple arguments or option arguments whenever possible–-make it just do one thing
* Tests
* Write a test for each use case
* At a minimim, include tests for each example you included in the README
* Write a test for every use case
* At a minimum, include tests for each example you included in the README
* Be sure to also test for cases that should throw exceptions
* Too thorough is better than not thorough enough
* TypeScript
* We're in the process of adding typescript defintions (`index.d.ts`) and tests (`index.tests.ts`) for every utility
* We're in the process of adding typescript definitions (`index.d.ts`) and tests (`index.tests.ts`) for every utility
* Please add these files for your new utility if you feel comfortable doing so. [Here's](https://github.com/angus-c/just/pull/247/files) an example PR.
* Also add `"types": "index.d.ts"` after `main` entry in package.json.
* You can verify new TypeScript definitions by running `yarn test-types` (This also gets run as part of the `yarn test` script)
* Interactive gh-pages ([http://anguscroll.com/just](anguscroll.com/just))
* We'll take care of this after we land your PR and publish the npm module
* Publishing the module and Interactive gh-pages ([http://anguscroll.com/just](anguscroll.com/just))
* We'll take care of both of these after we land your PR.

# README template
* Thanks to [Max Synnott](https://github.com/maxsynnott), local and global READMEs are now autogenerated from a template.
* Add a new section to [md-variables.com](https://github.com/angus-c/just/blob/master/md-variables.json) for your package:
* root key: the `name` value from your `package.json` (e.g. `just-comapct`)
* root key: the `name` value from your `package.json` (e.g. `just-compact`)
* `packageName`: same as root key
* `dir`: the directory you wrote your package in (e.g. `array-compact`)
* `description`: a one sentence description of what the utility does (for line breaks use an array of strings)
* `examples`: a comprehensive [array of example code](https://github.com/angus-c/just/blob/master/md-variables.json#L19) showing how to use the package
* try to add examples for mainstream cases and some edge cases
* start with an element for the `import` statement, followed by an empty string element
* follow up with usage examples, one element per example
* Finally run `yarn generate-readmes` or `npm run generate-readmes` to update all READMEs with your changes.

# App Testing
[Raul Melo](https://github.com/raulfdm) has written [a nice test framework](https://github.com/devraul/just-test) for testing cjs and esm imports of Just utilities in a variety of common app environments. Take advantage of this if you want to test how a module will work in the context of a given app.
Loading

0 comments on commit f73c527

Please sign in to comment.