Skip to content

Commit

Permalink
Merge pull request #50 from wso2/aw/2
Browse files Browse the repository at this point in the history
Add ESLint Checks for the Repository
  • Loading branch information
asekawa authored Mar 28, 2024
2 parents 6481639 + e456a67 commit e4f3e4d
Show file tree
Hide file tree
Showing 5 changed files with 7,469 additions and 4,927 deletions.
114 changes: 23 additions & 91 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -14,96 +14,28 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/

const path = require("path");

module.exports = {
env: {
browser: true,
es6: true,
jest: true,
node: true
},
extends: [
"plugin:cypress/recommended",
"eslint:recommended",
"plugin:import/typescript"
],
overrides: [
{
env: {
browser: true,
es6: true,
node: true
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
files: ["**/*.tsx", "**/*.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 9,
sourceType: "module"
},
rules: {
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-empty-function": [ "error", { "allow": ["constructors"] } ],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-use-before-define": [
"warn",
{
classes: false,
functions: false,
typedefs: false,
variables: false
}
],
"@typescript-eslint/triple-slash-reference": 0,
"eol-last": "error",
"no-use-before-define": "off"
}
}
],
parserOptions: {
ecmaVersion: 9,
sourceType: "module"
},
plugins: ["import"],
rules: {
"comma-dangle": ["warn", "never"],
"cypress/no-unnecessary-waiting": ["off"],
"eol-last": "error",
"import/order": [
"warn",
{
"alphabetize": {
caseInsensitive: true,
order: "asc"
},
"groups": ["builtin", "external", "index", "sibling", "parent", "internal"]
}
],
"max-len": ["warn", { "code": 120 }],
"no-console": "warn",
"no-duplicate-imports": "warn",
"object-curly-spacing": ["warn", "always"],
"quotes": ["warn", "double"],
"sort-imports": ["warn", {
"ignoreCase": false,
"ignoreDeclarationSort": true,
"ignoreMemberSort": false
}],
"sort-keys": [
"warn",
"asc",
{
"caseSensitive": true,
"minKeys": 2,
"natural": false
}
]
}
env: {
// other environments
jest: true,
},
extends: [
"plugin:@wso2/typescript",
"plugin:@wso2/strict",
"plugin:@wso2/internal",
"plugin:@wso2/prettier",
"plugin:cypress/recommended",
],
overrides: [],
parserOptions: {
project: [path.resolve(__dirname, "tsconfig.json")],
},
plugins: ["@wso2", "cypress"],
rules: {
"@typescript-eslint/no-useless-constructor": "off",
},
};
2 changes: 1 addition & 1 deletion .github/workflows/pr-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [16.x]

steps:
- name: Checkout
Expand Down
Loading

0 comments on commit e4f3e4d

Please sign in to comment.