Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
eslint-plugin-wpcalypso
Advanced tools
Custom ESLint rules for the WordPress.com Calypso project.
An ESLint configuration following WordPress.com's "Calypso" JavaScript Coding Guidelines. This package also includes custom ESLint rules for the WordPress.com Calypso project
Install ESLint and eslint-plugin-wpcalypso
$ yarn add --dev eslint eslint-plugin-wpcalypso
If you're planning to use the React superset of rules, you should also install eslint-plugin-react
and eslint-plugin-react-hooks
:
yarn add --dev eslint-plugin-react eslint-plugin-react-hooks
Simply extend the configuration from your project's .eslintrc
configuration file:
{
"extends": [ "plugin:wpcalypso/recommended" ]
}
Or, if your project uses React and you want to opt in to additional React-specific rules, extend the React superset:
{
"extends": [ "plugin:wpcalypso/react" ]
}
Any of the above options will:
wpcalypso
If you are not interesetd in the recommended set of rules but only on some of the custom rules, you can enable them individually.
First, add wpcalypso
to the plugins section of your .eslintrc
configuration file:
{
"plugins": [ "wpcalypso" ]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"wpcalypso/rule-name": "error"
}
}
i18n-ellipsis
: Disallow using three dots in translate stringsi18n-mismatched-placeholders
: Ensure placeholder counts match between singular and plural stringsi18n-named-placeholders
: Disallow multiple unnamed placeholdersi18n-no-collapsible-whitespace
: Disallow collapsible whitespace in translatable stringsi18n-no-placeholders-only
: Disallow strings which include only placeholdersi18n-no-this-translate
: Disallow this.translate()i18n-no-variables
: Disallow variables as translate stringsjsx-classname-namespace
: Ensure JSX className adheres to CSS namespace guidelinesjsx-gridicon-size
: Enforce recommended Gridicon size attributespost-message-no-wildcard-targets
: Disallow using the wildcard '*' in postMessage
redux-no-bound-selectors
: Disallow creation of selectors bound to Redux stateWant to suggest a change to our style guide? Edit the JavaScript Coding Guidelines on the Automattic/wp-calypso repository and submit a pull request.
Want to revise the ESLint rules used here? Edit the recommended.js
file and submit a pull request.
FAQs
Custom ESLint rules for the WordPress.com Calypso project.
We found that eslint-plugin-wpcalypso demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 50 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.