Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

102 changes: 0 additions & 102 deletions .eslintrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
if: ${{ github.actor == 'dependabot[bot]' }}
permissions:
contents: write

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Rollup and Jest configs in TypeScript
- Ignore code coverage output folder
- Migrate to eslint 9 flat config

### Removed

Expand All @@ -20,7 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Split up `CI` workflow into two separate workflows for the comment posting to work for PRs from forks.
- Ignore code coverage output folder

### Fixed

Expand Down
9 changes: 9 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import neolutionEslintConfig from "@neolution-ch/eslint-config-neolution";

export default [
...neolutionEslintConfig.configs.flat.getConfig({
...neolutionEslintConfig.configs.flat.defaults.typescript,
jest: true,
jsdocRequireJsdoc: true,
}),
];
15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
],
"scripts": {
"build": "rollup -c --configPlugin rollup-plugin-typescript2",
"lint": "eslint \"**/*.{ts,tsx}\" --cache --max-warnings 0",
"lint": "eslint --cache",
"prepack": "yarn build",
"prepare-pr": "yarn prettier . --write && yarn lint && yarn build && yarn test",
"prettier-check": "prettier --check .",
Expand All @@ -46,6 +46,7 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@neolution-ch/eslint-config-neolution": "^2.1.0",
"@release-it/keep-a-changelog": "^4.0.0",
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-node-resolve": "^15.0.2",
Expand All @@ -54,19 +55,13 @@
"@types/node": "^18.16.3",
"@types/rollup-plugin-peer-deps-external": "^2.2.5",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"concurrently": "^8.0.1",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsdoc": "^46.4.4",
"eslint": "^9.24.0",
"jest": "^29.6.1",
"jest-localstorage-mock": "^2.4.26",
"jiti": "^2.4.2",
"nodemon": "^2.0.22",
"prettier": "^2.8.8",
"prettier": "^3.5.3",
"release-it": "^16.1.2",
"rollup": "^3.21.4",
"rollup-plugin-peer-deps-external": "^2.2.4",
Expand Down
1 change: 1 addition & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const cleanDist: Plugin = {
writeBundle() {
fs.rmSync("./dist/rollup.config.d.ts", { force: true });
fs.rmSync("./dist/jest.config.d.ts", { force: true });
fs.rmSync("./dist/eslint.config.d.ts", { force: true });
},
};

Expand Down
2 changes: 1 addition & 1 deletion src/lib/localStorage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("localStorage tests", () => {
});

test("getLocalStorageItem expired", () => {
const expirationDate = new Date(new Date().getTime() - 1);
const expirationDate = new Date(Date.now() - 1);
localStorage.setItem("test", JSON.stringify({ data: true, expirationDate: expirationDate.toISOString() }));
expect(localStorage.length).toBe(1);
expect(getLocalStorageItem("test")).toBeUndefined();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/localStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface LocalStorageItem<T> {
*/
const checkLocalStorageSupport = () => {
if (typeof localStorage === "undefined") {
throw new Error("localStorage not supported");
throw new TypeError("localStorage not supported");
}
};

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
},
"include": ["src", "test"],
"exclude": ["node_modules", "dist", "coverage"],
"files": ["rollup.config.ts", "jest.config.ts"]
"files": ["rollup.config.ts", "jest.config.ts", "eslint.config.ts"]
}
Loading