Skip to content

Commit

Permalink
docs: use correct json content in md (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jun 29, 2022
1 parent 93facfb commit 928a60f
Show file tree
Hide file tree
Showing 8 changed files with 1,404 additions and 2,754 deletions.
1 change: 1 addition & 0 deletions .eslintignore
@@ -1 +1,2 @@
CHANGELOG.md
test/fixtures
34 changes: 22 additions & 12 deletions .eslintrc.json
Expand Up @@ -4,22 +4,32 @@
"mocha": true
},
"extends": [
"plugin:n/recommended",
"plugin:sonar/recommended",
"plugin:sonarjs/recommended",
"plugin:eslint-plugin/recommended",
"prettier"
],
"plugins": [
"self"
"@1stg",
"plugin:eslint-plugin/recommended"
],
"rules": {
"self/prettier": [
"error"
],
"eslint-plugin/report-message-format": [
"error",
"^[^a-z].*\\.$"
]
}
},
"overrides": [
{
"files": "*.js",
"plugins": [
"self"
],
"rules": {
"self/prettier": [
"error"
]
}
},
{
"files": "test/*.js",
"rules": {
"no-magic-numbers": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -16,9 +16,9 @@ jobs:
- 7
- 8
node-version:
- 12
- 14
- 16
- 18

steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions .remarkrc
@@ -0,0 +1,5 @@
{
"plugins": [
"@1stg/config"
]
}
34 changes: 24 additions & 10 deletions README.md
Expand Up @@ -114,7 +114,9 @@ If you’re fixing large of amounts of previously unformatted code, consider tem
- An object representing [options](https://prettier.io/docs/en/options.html) that will be passed into prettier. Example:

```json
"prettier/prettier": ["error", {"singleQuote": true, "parser": "flow"}]
{
"prettier/prettier": ["error", { "singleQuote": true, "parser": "flow" }]
}
```

NB: This option will merge and override any config set with `.prettierrc` files
Expand All @@ -126,22 +128,34 @@ If you’re fixing large of amounts of previously unformatted code, consider tem
- `usePrettierrc`: Enables loading of the Prettier configuration file, (default: `true`). May be useful if you are using multiple tools that conflict with each other, or do not wish to mix your ESLint settings with your Prettier configuration.

```json
"prettier/prettier": ["error", {}, {
"usePrettierrc": false
}]
{
"prettier/prettier": [
"error",
{},
{
"usePrettierrc": false
}
]
}
```

- `fileInfoOptions`: Options that are passed to [prettier.getFileInfo](https://prettier.io/docs/en/api.html#prettiergetfileinfofilepath--options) to decide whether a file needs to be formatted. Can be used for example to opt-out from ignoring files located in `node_modules` directories.

```json
"prettier/prettier": ["error", {}, {
"fileInfoOptions": {
"withNodeModules": true
}
}]
{
"prettier/prettier": [
"error",
{},
{
"fileInfoOptions": {
"withNodeModules": true
}
}
]
}
```

- The rule is autofixable -- if you run `eslint` with the `--fix` flag, your code will be formatted according to `prettier` style.
- The rule is auto fixable -- if you run `eslint` with the `--fix` flag, your code will be formatted according to `prettier` style.

---

Expand Down
16 changes: 9 additions & 7 deletions package.json
Expand Up @@ -9,7 +9,6 @@
"JounQin (https://github.com/JounQin) <admin@1stg.me>"
],
"license": "MIT",
"packageManager": "yarn@1.22.19",
"engines": {
"node": ">=12.0.0"
},
Expand All @@ -26,7 +25,7 @@
"scripts": {
"format": "yarn prettier '**/*.{js,json,md,yml}' --write && yarn lint --fix",
"lint": "eslint . --cache -f friendly --max-warnings 10",
"prepare": "simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"prerelease": "yarn format && yarn test",
"release": "changeset release",
"test": "yarn lint && mocha"
Expand All @@ -44,8 +43,8 @@
"prettier-linter-helpers": "^1.0.0"
},
"devDependencies": {
"@1stg/common-config": "^4.4.0",
"@1stg/eslint-config": "^4.3.0",
"@1stg/common-config": "~3.0.0",
"@1stg/eslint-config": "~3.0.0",
"@changesets/changelog-github": "^0.4.5",
"@changesets/cli": "^2.23.0",
"@graphql-eslint/eslint-plugin": "^2.5.0",
Expand All @@ -55,14 +54,17 @@
"eslint-mdx": "^1.17.0",
"eslint-plugin-eslint-plugin": "^4.3.0",
"eslint-plugin-mdx": "^1.17.0",
"eslint-plugin-prettier": "link:.",
"eslint-plugin-self": "^1.2.1",
"eslint-plugin-utils": "^0.1.0",
"graphql": "^16.5.0",
"mocha": "^9.2.2",
"patch-package": "^6.4.7",
"prettier": "^2.7.1",
"vue-eslint-parser": "^8.3.0"
},
"resolutions": {
"@babel/traverse": "^7.18.5"
}
"@babel/traverse": "^7.18.5",
"eslint-plugin-prettier": "link:."
},
"packageManager": "yarn@1.22.19"
}
21 changes: 21 additions & 0 deletions patches/@pkgr+utils+2.2.0.patch
@@ -0,0 +1,21 @@
diff --git a/node_modules/@pkgr/utils/lib/index.cjs b/node_modules/@pkgr/utils/lib/index.cjs
index cb7909a..a609f19 100644
--- a/node_modules/@pkgr/utils/lib/index.cjs
+++ b/node_modules/@pkgr/utils/lib/index.cjs
@@ -3,13 +3,13 @@
Object.defineProperty(exports, '__esModule', { value: true });

var child_process = require('child_process');
-var path = require('node:path');
-var node_url = require('node:url');
+var path = require('path');
+var node_url = require('url');
var spawn = require('cross-spawn');
var open = require('open');
var picocolors = require('picocolors');
var module$1 = require('module');
-var fs = require('node:fs');
+var fs = require('fs');
var isGlob = require('is-glob');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

0 comments on commit 928a60f

Please sign in to comment.