Add prettier-ci npm script (#3132)
This commit is contained in:
Родитель
7f5cb6753f
Коммит
60b3776909
|
@ -13,6 +13,7 @@ LICENSE
|
||||||
/locale/
|
/locale/
|
||||||
/node_modules/
|
/node_modules/
|
||||||
/tests/fixtures/
|
/tests/fixtures/
|
||||||
|
/coverage/
|
||||||
|
|
||||||
# white-list files we want to process
|
# white-list files we want to process
|
||||||
!*.js
|
!*.js
|
||||||
|
|
|
@ -15,6 +15,12 @@
|
||||||
"options": {
|
"options": {
|
||||||
"parser": "babel"
|
"parser": "babel"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": "*.md",
|
||||||
|
"options": {
|
||||||
|
"proseWrap": "preserve"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
# run integration tests using an addons-linter binary in a production-like environment
|
# run integration tests using an addons-linter binary in a production-like environment
|
||||||
- npm run test-integration:production
|
- npm run test-integration:production
|
||||||
|
- npm run prettier-ci
|
||||||
notifications:
|
notifications:
|
||||||
slack:
|
slack:
|
||||||
if: branch = master
|
if: branch = master
|
||||||
|
|
|
@ -151,6 +151,7 @@ Dependencies are automatically kept up-to-date using [renovatebot](https://renov
|
||||||
| npm run test-coverage-once | Runs the tests once with coverage |
|
| npm run test-coverage-once | Runs the tests once with coverage |
|
||||||
| npm run test-integration-linter | Runs our integration test-suite |
|
| npm run test-integration-linter | Runs our integration test-suite |
|
||||||
| npm run prettier | Automatically format the whole code-base with Prettier |
|
| npm run prettier | Automatically format the whole code-base with Prettier |
|
||||||
|
| npm run prettier-ci | Run [Prettier][] and fail if some code has been changed without being formatted |
|
||||||
| npm run prettier-dev | Automatically compare and format modified source files against the master branch |
|
| npm run prettier-dev | Automatically compare and format modified source files against the master branch |
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
|
@ -221,3 +222,4 @@ After merging the PR, [create a new release][new release] with the same tag name
|
||||||
|
|
||||||
[new release]: https://github.com/mozilla/addons-linter/releases/new
|
[new release]: https://github.com/mozilla/addons-linter/releases/new
|
||||||
[semver]: http://semver.org/
|
[semver]: http://semver.org/
|
||||||
|
[prettier]: https://prettier.io/
|
||||||
|
|
|
@ -7,7 +7,7 @@ Rules are sorted by severity.
|
||||||
## JavaScript
|
## JavaScript
|
||||||
|
|
||||||
| Message code | Severity | Description |
|
| Message code | Severity | Description |
|
||||||
| -------------------------- | -------- | -------------------------------------------------------------------------------------- |
|
| --------------------------- | -------- | -------------------------------------------------------------------------------------- |
|
||||||
| `KNOWN_LIBRARY` | notice | This is version of a JS library is known and generally accepted. |
|
| `KNOWN_LIBRARY` | notice | This is version of a JS library is known and generally accepted. |
|
||||||
| `OPENDIALOG_NONLIT_URI` | notice | openDialog called with non-literal parameter. |
|
| `OPENDIALOG_NONLIT_URI` | notice | openDialog called with non-literal parameter. |
|
||||||
| `EVENT_LISTENER_FOURTH` | notice | `addEventListener` called with truthy fourth argument. |
|
| `EVENT_LISTENER_FOURTH` | notice | `addEventListener` called with truthy fourth argument. |
|
||||||
|
@ -21,8 +21,8 @@ Rules are sorted by severity.
|
||||||
| `STORAGE_SYNC` | warning | Temporary IDs can cause issues with `storage.sync`. |
|
| `STORAGE_SYNC` | warning | Temporary IDs can cause issues with `storage.sync`. |
|
||||||
| `STORAGE_MANAGED` | warning | Temporary IDs can cause issues with `storage.managed`. |
|
| `STORAGE_MANAGED` | warning | Temporary IDs can cause issues with `storage.managed`. |
|
||||||
| `IDENTITY_GETREDIRECTURL` | warning | Temporary IDs can cause issues with `identity.getRedirectURL`. |
|
| `IDENTITY_GETREDIRECTURL` | warning | Temporary IDs can cause issues with `identity.getRedirectURL`. |
|
||||||
| `RUNTIME_ONMESSAGEEXTERNAL`| warning | Temporary IDs can cause issues with `runtime.onMessageExternal`. |
|
| `RUNTIME_ONMESSAGEEXTERNAL` | warning | Temporary IDs can cause issues with `runtime.onMessageExternal`. |
|
||||||
| `RUNTIME_ONCONNECTEXTERNAL`| warning | Temporary IDs can cause issues with `runtime.onConnectExternal`. |
|
| `RUNTIME_ONCONNECTEXTERNAL` | warning | Temporary IDs can cause issues with `runtime.onConnectExternal`. |
|
||||||
| `BANNED_LIBRARY` | error | This version of a JS library is banned for security reasons. |
|
| `BANNED_LIBRARY` | error | This version of a JS library is banned for security reasons. |
|
||||||
| `INCOMPATIBLE_API` | warning | API not compatible with `applications.gecko.strict_min_version` |
|
| `INCOMPATIBLE_API` | warning | API not compatible with `applications.gecko.strict_min_version` |
|
||||||
| `ANDROID_INCOMPATIBLE_API` | warning | API not compatible with Firefox for Android at `applications.gecko.strict_min_version` |
|
| `ANDROID_INCOMPATIBLE_API` | warning | API not compatible with Firefox for Android at `applications.gecko.strict_min_version` |
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
"test-integration:production": "node tests/integration/run-as-production-env.js test-integration tests/integration/addons-linter",
|
"test-integration:production": "node tests/integration/run-as-production-env.js test-integration tests/integration/addons-linter",
|
||||||
"lint": "npm run eslint",
|
"lint": "npm run eslint",
|
||||||
"prettier": "prettier --write '**'",
|
"prettier": "prettier --write '**'",
|
||||||
|
"prettier-ci": "prettier --list-different '**' || (echo '\n\nThis failure means you did not run `npm run prettier-dev` before committing\n\n' && exit 1)",
|
||||||
"prettier-dev": "pretty-quick --branch master",
|
"prettier-dev": "pretty-quick --branch master",
|
||||||
"publish-rules": "scripts/build-rules && cp node_modules/gfm.css/gfm.css docs/html/gfm.css && scripts/publish-rules",
|
"publish-rules": "scripts/build-rules && cp node_modules/gfm.css/gfm.css docs/html/gfm.css && scripts/publish-rules",
|
||||||
"gen-contributing-toc": "doctoc CONTRIBUTING.md"
|
"gen-contributing-toc": "doctoc CONTRIBUTING.md"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче