This commit is contained in:
William Durand 2020-04-27 10:50:47 +02:00 коммит произвёл GitHub
Родитель 7f5cb6753f
Коммит 60b3776909
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 31 добавлений и 20 удалений

Просмотреть файл

@ -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/

Просмотреть файл

@ -6,26 +6,26 @@ 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. |
| `UNEXPECTED_GLOGAL_ARG` | warning | Unexpected global passed as an argument. | | `UNEXPECTED_GLOGAL_ARG` | warning | Unexpected global passed as an argument. |
| `NO_IMPLIED_EVAL` | warning | disallow the use of `eval()`-like methods. | | `NO_IMPLIED_EVAL` | warning | disallow the use of `eval()`-like methods. |
| `OPENDIALOG_REMOTE_URI` | warning | openDialog called with non-local URI. | | `OPENDIALOG_REMOTE_URI` | warning | openDialog called with non-local URI. |
| `NO_DOCUMENT_WRITE` | warning | Use of `document.write` strongly discouraged. | | `NO_DOCUMENT_WRITE` | warning | Use of `document.write` strongly discouraged. |
| `JS_SYNTAX_ERROR` | warning | JavaScript compile-time error. | | `JS_SYNTAX_ERROR` | warning | JavaScript compile-time error. |
| `UNADVISED_LIBRARY` | warning | This version of a JS library is not recommended. | | `UNADVISED_LIBRARY` | warning | This version of a JS library is not recommended. |
| `DEPRECATED_API` | warning | API is deprecated. | | `DEPRECATED_API` | warning | API is deprecated. |
| `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` |
## Markup ## Markup

Просмотреть файл

@ -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"