Skip to content

Commit 3c5af82

Browse files
use scality guidelines as linting rules
ISSUE: CLDSRVCLT-2
1 parent 701bdfa commit 3c5af82

File tree

4 files changed

+382
-152
lines changed

4 files changed

+382
-152
lines changed

.eslintrc.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
3+
import js from "@eslint/js";
4+
import { FlatCompat } from "@eslint/eslintrc";
5+
import tseslint from 'typescript-eslint';
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all
13+
});
14+
15+
export default tseslint.config(
16+
{
17+
ignores: [
18+
'**/build/**',
19+
'**/dist/**',
20+
'**/node_modules/**',
21+
'*.js',
22+
'**/coverage/**',
23+
],
24+
},
25+
...compat.extends('@scality/scality'),
26+
...tseslint.configs.recommended,
27+
{
28+
rules: {
29+
'@typescript-eslint/no-explicit-any': 'warn',
30+
'@typescript-eslint/no-unused-vars': ['error', {
31+
argsIgnorePattern: '^_',
32+
varsIgnorePattern: '^_',
33+
caughtErrorsIgnorePattern: '^_'
34+
}],
35+
'@typescript-eslint/ban-ts-comment': 'off',
36+
}
37+
}
38+
);

package.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"description": "Smithy-generated TypeScript client for Cloudserver's internal APIs",
88
"main": "dist/index.js",
9-
"types": "dist/index.d.ts",
9+
"types": "dist/index.d.ts",
1010
"files": [
1111
"dist",
1212
"build/smithy/source/typescript-codegen"
@@ -27,22 +27,25 @@
2727
"test:raft": "jest tests/testRaftApis.test.ts",
2828
"test:mongo-backend": "yarn test:indexes && yarn test:error-handling && yarn test:multiple-backend",
2929
"test:metadata-backend": "yarn test:api && yarn test:lifecycle && yarn test:metadata && yarn test:raft",
30-
"lint": "eslint . --ext .ts,.tsx",
30+
"lint": "eslint src tests",
3131
"typecheck": "tsc --noEmit"
3232
},
3333
"devDependencies": {
34-
"typescript": "^5.7.3",
34+
"@eslint/compat": "^2.0.0",
35+
"@scality/eslint-config-scality": "scality/Guidelines#8.3.0",
3536
"@types/jest": "^30.0.0",
37+
"@typescript-eslint/eslint-plugin": "^6.21.0",
38+
"@typescript-eslint/parser": "^6.21.0",
39+
"eslint": "^9.37.0",
3640
"jest": "^30.2.0",
3741
"ts-jest": "^29.4.4",
38-
"eslint": "^8.57.0",
39-
"@typescript-eslint/eslint-plugin": "^6.21.0",
40-
"@typescript-eslint/parser": "^6.21.0"
42+
"typescript": "^5.7.3",
43+
"typescript-eslint": "^8.49.0"
4144
},
4245
"dependencies": {
43-
"fast-xml-parser": "^4.3.2",
4446
"@aws-sdk/client-s3": "^3.896.0",
45-
"JSONStream": "^1.3.5"
47+
"JSONStream": "^1.3.5",
48+
"fast-xml-parser": "^4.3.2"
4649
},
4750
"author": "Scality",
4851
"license": "Apache-2.0",

0 commit comments

Comments
 (0)