Skip to content

Commit de612b6

Browse files
committed
chore: fix lint and formatting issues
1 parent 72e22d4 commit de612b6

11 files changed

+314
-36
lines changed

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Global ignore file incase if a child package doesn't include one.
2+
3+
/dist
4+
/build
5+
/node_modules
6+
/coverage

.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
3+
*
4+
* WSO2 LLC. licenses this file to you under the Apache License,
5+
* Version 2.0 (the "License"); you may not use this file except
6+
* in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing,
12+
* software distributed under the License is distributed on an
13+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
* KIND, either express or implied. See the License for the
15+
* specific language governing permissions and limitations
16+
* under the License.
17+
*/
18+
19+
module.exports = {
20+
env: {
21+
es6: true,
22+
node: true,
23+
},
24+
extends: ['plugin:@wso2/internal', 'plugin:@wso2/prettier'],
25+
plugins: ['@wso2'],
26+
};

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Global ignore file incase if a child package doesn't include one.
2+
3+
/dist
4+
/build
5+
/node_modules
6+
/coverage

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
"devDependencies": {
3232
"@changesets/changelog-github": "^0.5.0",
3333
"@changesets/cli": "^2.27.3",
34-
"nx": "18.2.4"
34+
"@wso2/eslint-plugin": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?fa0b844715320a3953d6d055997c0770f8695082",
35+
"@wso2/prettier-config": "https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/prettier-config?fa0b844715320a3953d6d055997c0770f8695082",
36+
"eslint": "~8.57.0",
37+
"nx": "18.2.4",
38+
"prettier": "^3.2.5"
3539
},
3640
"workspaces": [
3741
"packages/*",

packages/core/.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/dist
2+
/build
23
/node_modules
4+
/coverage

packages/core/.eslintrc.cjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,21 @@ module.exports = {
2525
},
2626
plugins: ['@wso2'],
2727
rules: {
28+
// In `getBrandingCSS` we are using non dot notation to access the object properties.
29+
// TODO: Refactor the code to use dot notation.
30+
'@typescript-eslint/dot-notation': 'off',
2831
'@typescript-eslint/no-empty-function': [
2932
'error',
3033
{
3134
allow: ['constructors'],
3235
},
3336
],
37+
// We are throwing custom exceptions in the codebase.
38+
// Hence, turning this off to avoid linting errors. (https://eslint.org/docs/latest/rules/no-throw-literal#known-limitations)
39+
'@typescript-eslint/no-throw-literal': 'off',
40+
// We need to use private constructors in some classes.
41+
// Hence, turning this off to avoid linting errors.
42+
// TODO: Ideally suppression should be done inline for these cases. But it seems to not work ATM.
43+
'@typescript-eslint/no-useless-constructor': 'off',
3444
},
3545
};

packages/core/tsconfig.eslint.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"extends": "./tsconfig.json",
3-
"include": [
4-
"**/.*.js",
5-
"**/.*.cjs",
6-
"**/.*.ts",
7-
"**/*.js",
8-
"**/*.cjs",
9-
"**/*.ts",
10-
]
11-
}
2+
"extends": "./tsconfig.json",
3+
"include": [
4+
"**/.*.js",
5+
"**/.*.cjs",
6+
"**/.*.ts",
7+
"**/*.js",
8+
"**/*.cjs",
9+
"**/*.ts",
10+
]
11+
}

packages/core/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
"references": [
3131
{
3232
"path": "./tsconfig.lib.json"
33+
},
34+
{
35+
"path": "./tsconfig.spec.json"
3336
}
3437
]
3538
}

packages/core/tsconfig.lib.json

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
{
2-
"extends": "./tsconfig.json",
3-
"compilerOptions": {
4-
"declaration": true,
5-
"outDir": "dist",
6-
"declarationDir": "types",
7-
"types": ["node"],
8-
"emitDeclarationOnly": true
9-
},
10-
"files": [],
11-
"exclude": [
12-
"test-configs",
13-
"jest.config.ts",
14-
"**/*.spec.ts",
15-
"**/*.test.ts",
16-
"**/*.spec.tsx",
17-
"**/*.test.tsx",
18-
"**/*.spec.js",
19-
"**/*.test.js",
20-
"**/*.spec.jsx",
21-
"**/*.test.jsx",
22-
"dist"
23-
],
24-
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "rollup.config.cjs"]
25-
}
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"declaration": true,
5+
"outDir": "dist",
6+
"declarationDir": "types",
7+
"types": ["node"],
8+
"emitDeclarationOnly": true
9+
},
10+
"exclude": [
11+
"**/*.spec.ts",
12+
"**/*.test.ts",
13+
"**/*.spec.tsx",
14+
"**/*.test.tsx",
15+
"**/*.spec.js",
16+
"**/*.test.js",
17+
"**/*.spec.jsx",
18+
"**/*.test.jsx"
19+
],
20+
"include": ["src/**/*.js", "src/**/*.ts"]
21+
}

0 commit comments

Comments
 (0)