This repository was archived by the owner on Jun 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4af7bc4
commit 513e650
Showing
3 changed files
with
169 additions
and
119 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,40 @@ | ||
# Options | ||
|
||
With most config key, you can set it to either `off`, `cozy`, `strict`, or `excessive` | ||
|
||
## Behavior | ||
|
||
- Exceptions include obviously temporary errors (ex. `no-lone-blocks` (`{}`)) (which may be _off_ or _warning_ when `NODE_ENV === development`) | ||
- prevents premature distracting red error lines in code editors | ||
|
||
### off | ||
|
||
Turns of all functionality | ||
|
||
### cozy | ||
|
||
Catches code that has / is | ||
|
||
- aggregous errors | ||
- non-aggregous auto-fixable errors | ||
- hard to debug / easy to be buggy | ||
- isn't obviously buggy (but is buggy) | ||
- not unobviously buggy (and isn't) | ||
- deprecated syntax | ||
|
||
### strict | ||
|
||
Catches code that has / is | ||
|
||
- not up to best practices | ||
- unecessarily verbose / unecessarily misleading | ||
- ex. needlessly using `.bind()` | ||
- ambiguous | ||
- essentially similar to what you would expect from `eslint-config-airbnr`, `stylelint-config-standard`, etc. | ||
|
||
### excessive | ||
|
||
Essentially the same as `strict`, but includes options that are | ||
more annoying than helpfull when coding a project | ||
|
||
- ex. forcing default to exist at end of switch |
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,27 @@ | ||
## Building your own modules | ||
|
||
### How to make a `preset` | ||
|
||
TODO: make a template repo so it's actualy clear | ||
|
||
it's similar to other tools. feel free to use esmodules and `export default`, since everything (including non-plugin code) is loaded with the `esm` package. within your plugin, you must dynamically import with the `import()` any syntax (or `require()`) any modules that require on `FOX_SUITE` environment variables | ||
|
||
### Treatment of `template` files | ||
|
||
Files are copied over from your plugin's `template` directly to the project's root directory - templated with `handlebars` (see variables below) - json files are merged with existing json files | ||
|
||
- opt to use `(await getProjectData()).location` over `path.dirname((await import('read-pkg-up')()).path)`-ish over `process.cwd()` where applicable | ||
|
||
```sh | ||
these are the variables and options passd to handlebars | ||
{ | ||
noEscape: true, | ||
data: { | ||
projectLocation: projectData.location, | ||
projectFoxConfigPath: projectData.foxConfigPath, | ||
projectPackageJsonPath: projectData.packageJsonPath, | ||
pluginRoot: pluginData.pluginRoot, | ||
pluginTemplateDir: pluginData.templateDir | ||
} | ||
} | ||
``` |
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