Skip to content

Commit 5381601

Browse files
committed
fix: integrate standard eslint rules and add tsup to export types, cjs version
1 parent 2a92c64 commit 5381601

File tree

4 files changed

+1116
-57
lines changed

4 files changed

+1116
-57
lines changed

packages/sdk-analytics/eslint.config.js

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import base, { createConfig } from '@metamask/eslint-config';
2+
import typescript from '@metamask/eslint-config-typescript';
3+
import tseslint from '@typescript-eslint/eslint-plugin';
4+
5+
const config = createConfig(
6+
{
7+
// The TypeScript config disables certain rules that you want to keep for
8+
// non-TypeScript files, so it should be added in an override.
9+
files: ['src/**/*.ts', '!src/schema.ts'],
10+
ignores: ['dist/**', 'node_modules/**'],
11+
extends: [
12+
// This should be added last unless you know what you're doing.
13+
...base,
14+
...typescript,
15+
],
16+
rules: {
17+
...tseslint.configs['recommended'].rules,
18+
'indent': ['error', 2],
19+
'linebreak-style': ['error', 'unix'],
20+
'quotes': ['error', 'single'],
21+
'semi': ['error', 'always'],
22+
'@typescript-eslint/naming-convention': 'off',
23+
},
24+
languageOptions: {
25+
parserOptions: {
26+
// This is required for rules that use type information.
27+
// See here for more information: https://typescript-eslint.io/getting-started/typed-linting
28+
tsconfigRootDir: import.meta.dirname,
29+
},
30+
},
31+
}
32+
);
33+
34+
export default config;
35+
36+
37+

packages/sdk-analytics/package.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,30 @@
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"scripts": {
8-
"build": "tsc --build",
9-
"lint": "eslint . --ext .ts,.tsx",
10-
"lint:fix": "eslint . --ext .ts,.tsx --fix",
8+
"build": "tsup src/index.ts --dts",
9+
"lint": "eslint src --ext .ts,.tsx",
10+
"lint:fix": "eslint src --ext .ts,.tsx --fix",
1111
"test": "vitest",
12-
"test:ci": "vitest --run"
12+
"test:ci": "vitest --run",
13+
"allow-scripts": ""
1314
},
1415
"devDependencies": {
16+
"@metamask/eslint-config": "^14.0.0",
17+
"@metamask/eslint-config-typescript": "^14.0.0",
1518
"@typescript-eslint/eslint-plugin": "^8.31.0",
1619
"@typescript-eslint/parser": "^8.31.0",
1720
"eslint": "^9.25.1",
21+
"eslint-config-prettier": "^9.1.0",
22+
"eslint-import-resolver-typescript": "^4.3.4",
23+
"eslint-plugin-import-x": "^4.3.0",
24+
"eslint-plugin-jsdoc": "^50.2.4",
25+
"eslint-plugin-prettier": "^5.2.1",
26+
"eslint-plugin-promise": "^7.1.0",
1827
"nock": "^14.0.4",
28+
"prettier": "^3.3.3",
29+
"tsup": "^8.4.0",
1930
"typescript": "^5.8.3",
31+
"typescript-eslint": "^8.6.0",
2032
"vitest": "^3.1.2"
2133
},
2234
"private": true,

0 commit comments

Comments
 (0)