Skip to content

Commit

Permalink
feat: use pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
edvardchen committed Sep 13, 2024
1 parent f81a8fb commit 394250d
Show file tree
Hide file tree
Showing 16 changed files with 3,853 additions and 11,198 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
npm test
pnpm i --frozen-lockfile
pnpm run build --if-present
pnpm test
env:
CI: true
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
git config --global user.email ${GITHUB_ACTOR}@users.noreply.github.com
- name: npm install, build, and release
run: |
npm ci
npx standard-version
git push --follow-tags
pnpm i --frozen-lockfile
pnpx standard-version
npm publish
git push --follow-tags
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CI: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules/
.*
!.github
21 changes: 21 additions & 0 deletions examples/app-with-eslint7/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require('@rushstack/eslint-patch/modern-module-resolution');

module.exports = {
root: true,
env: {
browser: true,
es6: true,
},
extends: ['plugin:i18next/recommended'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {
'i18next/no-literal-string': ['error', { mode: 'all' }],
},
};
2 changes: 2 additions & 0 deletions examples/app-with-eslint7/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const a = 'hello';
console.log(a);
21 changes: 21 additions & 0 deletions examples/app-with-eslint7/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "app-with-eslint7",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"lint": "node test.mjs"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"eslint-plugin-i18next": "workspace:*",
"zx": "^8.1.6"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.10.4",
"eslint": "^7.0.0",
"globals": "^15.8.0"
}
}
9 changes: 9 additions & 0 deletions examples/app-with-eslint7/test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { $ } from 'zx';
import assert from 'assert';

(async () => {
await $({})`eslint index.js -f json`.catch(e => {
const [error] = JSON.parse(e.stdout);
assert(error.errorCount === 1, 'expect to have one lint error');
});
})();
5 changes: 4 additions & 1 deletion examples/app-with-eslint9/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import pluginJs from '@eslint/js';
import i18next from 'eslint-plugin-i18next';

export default [
{ languageOptions: { globals: globals.browser } },
{
languageOptions: { globals: globals.browser },
linterOptions: { reportUnusedDisableDirectives: 'error' },
},
pluginJs.configs.recommended,
{
plugins: { i18next },
Expand Down
3 changes: 3 additions & 0 deletions examples/app-with-eslint9/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
// if it doesn't break the rule no-literal-string, it will report unused disable directive

// eslint-disable-next-line i18next/no-literal-string
const a = 'hello';
console.log(a);
2 changes: 1 addition & 1 deletion examples/app-with-eslint9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"eslint-plugin-i18next": "link:/Users/edward/workspace/github/eslint-plugin-i18next"
"eslint-plugin-i18next": "workspace:*"
},
"devDependencies": {
"@eslint/js": "^9.6.0",
Expand Down
Loading

0 comments on commit 394250d

Please sign in to comment.