Skip to content

Commit

Permalink
Merge pull request #3 from agama-project/move_to_agama-project
Browse files Browse the repository at this point in the history
Move the package to the "agama-project" NPM organization
  • Loading branch information
lslezak authored Dec 10, 2024
2 parents 0ce22cf + 9e93509 commit f60d447
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@ literals are passed to the translation functions.
It is closely tied to the [Agama](https://github.com/agama-project/agama) project and
probably does not make much sense for other projects.

## Installation

Run

```shell
npm install --save-dev @agama-project/eslint-plugin-agama-i18n
```

Update your ESLint configuration:

```js
// eslint.config.mjs
import agamaI18nEslintPlugin from "@agama-project/eslint-plugin-agama-i18n";

export default [
{
plugins: {
"agama-i18n": agamaI18nEslintPlugin,
},
},
{
rules: {
"agama-i18n/string-literals": "error",
}
}
];
```

## Disabling the Check

In some rare cases using a variable instead of a string literal is correct. In
Expand All @@ -24,6 +52,12 @@ const sz = getSize();
return <span>{_(sz)}</span>;
```

## Publishing new version

The NPM package is automatically published by a GitHub Action when a version tag is created.

To create a new tag update the version in `package.json` and run the `npm run tag` command.

## Links

- https://eslint.org/docs/latest/extend/custom-rule-tutorial - tutorial for
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"name": "eslint-plugin-agama-i18n",
"version": "0.1.2",
"name": "@agama-project/eslint-plugin-agama-i18n",
"version": "1.0.0",
"description": "A simple ESLint plugin which checks that only string literals are passed to the translation functions",
"homepage": "https://github.com/agama-project/eslint-plugin-agama-i18n",
"repository": {
"type": "git",
"url": "git+https://github.com/agama-project/eslint-plugin-agama-i18n.git"
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "eslint-plugin-agama-i18n.js",
"scripts": {
"test": "node string-literals.test.js"
"test": "node string-literals.test.js",
"tag": "VERSION=`jq -r .version package.json` && echo git tag -s -m \"Version $VERSION\" v$VERSION && echo git push origin v$VERSION"
},
"peerDependencies": {
"eslint": ">=9.0.0"
Expand Down

0 comments on commit f60d447

Please sign in to comment.