Skip to content

Commit e0c9c42

Browse files
committed
feat: Update ESLint configuration and package scripts to use shared config
1 parent 49ab197 commit e0c9c42

File tree

14 files changed

+78
-29
lines changed

14 files changed

+78
-29
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
module.exports = {
2-
root: true,
32
extends: [
43
'eslint:recommended',
54
'plugin:@typescript-eslint/recommended'

eslint.config.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import eslint from '@eslint/js';
2+
import tsEslint from '@typescript-eslint/eslint-plugin';
3+
import tsParser from '@typescript-eslint/parser';
4+
import globals from 'globals';
5+
6+
const tsConfig = tsEslint.configs.recommended[0];
7+
8+
export default [
9+
eslint.configs.recommended,
10+
{
11+
...tsConfig,
12+
files: ['**/*.ts'],
13+
languageOptions: {
14+
parser: tsParser,
15+
parserOptions: {
16+
ecmaVersion: 'latest',
17+
sourceType: 'module'
18+
},
19+
globals: {
20+
...globals.browser,
21+
...globals.node
22+
}
23+
},
24+
ignores: ['dist/', 'node_modules/'],
25+
rules: {
26+
// Disable some rules
27+
'no-unused-vars': 'off',
28+
'@typescript-eslint/no-unused-vars': 'off',
29+
'no-undef': 'off',
30+
31+
// Add project-specific rule overrides here
32+
}
33+
},
34+
{
35+
files: ['**/*.test.ts'],
36+
languageOptions: {
37+
globals: {
38+
describe: 'readonly',
39+
it: 'readonly',
40+
expect: 'readonly',
41+
jest: 'readonly'
42+
}
43+
}
44+
}
45+
];

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@mixcore/javascript-sdk",
33
"private": true,
4+
"type": "module",
45
"version": "0.0.1",
56
"description": "Modular, framework-agnostic SDK for Mixcore projects (shared, base, apis)",
67
"workspaces": [
@@ -18,6 +19,7 @@
1819
"@types/node": "^20.0.0",
1920
"@typescript-eslint/eslint-plugin": "^8.38.0",
2021
"@typescript-eslint/parser": "^8.38.0",
22+
"globals": "^16.3.0",
2123
"jest": "^30.0.5",
2224
"lerna": "^7.0.0",
2325
"ts-jest": "^29.4.0",

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1111
"test": "jest",
12-
"lint": "eslint src --ext .ts"
12+
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
1313
},
1414
"dependencies": {
1515
"@mixcore/shared": "workspace:*"

packages/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
11-
"lint": "eslint src --ext .ts"
11+
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
1212
},
1313
"dependencies": {
1414
"@mixcore/api": "workspace:*"

packages/config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1111
"test": "jest",
12-
"lint": "eslint src --ext .ts"
12+
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
1313
},
1414
"dependencies": {
1515
"@mixcore/shared": "workspace:*",

packages/database/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
11-
"lint": "eslint src --ext .ts"
11+
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
1212
},
1313
"dependencies": {
1414
"@mixcore/api": "workspace:*",

packages/file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
11-
"lint": "eslint src --ext .ts"
11+
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
1212
},
1313
"dependencies": {
1414
"@mixcore/api": "workspace:*"

packages/navigation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest --passWithNoTests",
11-
"lint": "eslint src --ext .ts"
11+
"lint": "eslint src --ext .ts --config ../../.eslintrc.js"
1212
},
1313
"license": "SEE LICENSE IN LICENSE",
1414
"repository": "https://github.com/mixcore/javascript-sdk",

packages/shared/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,24 @@
88
"scripts": {
99
"build": "tsup src/index.ts --dts --format esm,cjs --out-dir dist",
1010
"test": "jest",
11-
"lint": "eslint src --ext .ts"
11+
"lint": "eslint src --ext .ts --config ../../eslint.config.js"
1212
},
1313
"license": "SEE LICENSE IN LICENSE",
1414
"repository": "https://github.com/mixcore/javascript-sdk",
1515
"publishConfig": {
1616
"access": "public"
1717
},
18-
"keywords": ["mixcore", "sdk", "shared", "typescript", "framework-agnostic"],
18+
"keywords": [
19+
"mixcore",
20+
"sdk",
21+
"shared",
22+
"typescript",
23+
"framework-agnostic"
24+
],
1925
"engines": {
2026
"node": ">=18.0.0"
27+
},
28+
"dependencies": {
29+
"globals": "^16.3.0"
2130
}
2231
}

0 commit comments

Comments
 (0)