Skip to content

Commit

Permalink
[CI]: fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Jan 29, 2024
1 parent 2a635be commit 6e98f3f
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 94 deletions.
41 changes: 15 additions & 26 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"standard-with-typescript",
"prettier"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {},
"ignorePatterns": [
"coverage",
"dist",
"__tests__/",
"jest.config.js",
"*.yml",
"mongo-init.js",
"bable.config.js",
]
}
"env": {
"es2021": true,
"node": true
},
"extends": ["standard-with-typescript", "prettier"],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {},
"ignorePatterns": ["coverage", "dist", "__tests__/", "jest.config.js", "*.yml", "mongo-init.js", "bable.config.js"]
}
Empty file added .prettierignore
Empty file.
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"printWidth": 120,
"trailingComma": "all",
"singleQuote": true
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Maintainability](https://api.codeclimate.com/v1/badges/e1239b895f0ee2569b61/maintainability)](https://codeclimate.com/github/RnDAO/tc-discordBot/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/e1239b895f0ee2569b61/test_coverage)](https://codeclimate.com/github/RnDAO/tc-discordBot/test_coverage)

# tc-discordBot
# tc-discordBot
2 changes: 1 addition & 1 deletion bable.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// eslint-disable-next-line no-undef
module.exports = { presets: ['@babel/preset-env'] }
module.exports = { presets: ['@babel/preset-env'] };
5 changes: 2 additions & 3 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ services:
- NODE_ENV=test
- DB_HOST=mongo
- DB_PORT=27017
- DB_USER=user
- DB_PASSWORD=1234
- DB_USER=root
- DB_PASSWORD=pass
- DB_NAME=RnDAO
- DISCORD_CLIENT_ID=1
- DISCORD_CLIENT_SECRET=1
Expand Down Expand Up @@ -40,7 +40,6 @@ services:
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=pass
- MONGO_INITDB_DATABASE=RnDAO
volumes:
- ./docker-entrypoint-initdb.d/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
healthcheck:
Expand Down
39 changes: 17 additions & 22 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
// eslint-disable-next-line no-undef
module.exports = {
testPathIgnorePatterns: [
"/__tests__/fixtures",
"/__tests__/utils",
],
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
"^.+\\.(js|jsx)$": "babel-jest",
testPathIgnorePatterns: ['/__tests__/fixtures', '/__tests__/utils'],
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
'^.+\\.(js|jsx)$': 'babel-jest',
},
collectCoverage: true,
testEnvironment: 'node',
coverageReporters: ['json', 'lcov', 'text', 'clover', 'html'],
collectCoverageFrom: ['src/**/*.ts*'],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: -10,
},
collectCoverage: true,
testEnvironment: "node",
coverageReporters: ["json", "lcov", "text", "clover", "html"],
collectCoverageFrom: [
"src/**/*.ts*"
],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: -10,
},
}
};
},
};
8 changes: 4 additions & 4 deletions mongo-init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
print("Started Adding the Users.");
db = db.getSiblingDB("RnDAO");
db.createUser({ user: "user", pwd: "1234", roles: ["readWrite"] })
print("End Adding the User Roles.");
print('Started Adding the Users.');
db = db.getSiblingDB('RnDAO');
db.createUser({ user: 'root', pwd: 'pass', roles: ['readWrite'] });
print('End Adding the User Roles.');
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test:ci": "jest --ci --detectOpenHandles",
"lint": "eslint **/*.ts",
"lint-fix": "eslint --fix **/*.ts",
"format": "prettier --write \"src/**/*.ts\" \"types/*.ts\" \"__tests__/**/*.ts\"",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\" \"types/*.ts\" \"__tests__/**/*.ts\" \"*.js\" \"*.json\" \"*.md\"",
"migrate:create": "migrate create --template-file ./src/migrations/utils/template.ts --migrations-dir=\"./src/migrations/db\"",
"migrate:up": "migrate --migrations-dir=\"./lib/migrations/db\" up",
"migrate:down": "migrate --migrations-dir=\"./lib/migrations/db\" down"
Expand Down Expand Up @@ -68,4 +68,4 @@
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
}
}
}
2 changes: 1 addition & 1 deletion src/migrations/utils/ts-compiler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const tsNode = require('ts-node');
module.exports = tsNode.register;
module.exports = tsNode.register;
57 changes: 24 additions & 33 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"declaration": false,
"removeComments": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "ES2017",
"sourceMap": false,
"outDir": "./lib",
"baseUrl": "./",
"incremental": true,
"strict": true,
"noImplicitAny": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
},
"include": [
"src/**/*",
"__tests__/**/*",
"types/**/*"
],
"ts-node": {
"transpileOnly": true,
"files": true
},
"exclude": [
"./coverage",
"./lib",
"__tests__",
"jest.config.js"
],
}
"compilerOptions": {
"module": "commonjs",
"declaration": false,
"removeComments": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "ES2017",
"sourceMap": false,
"outDir": "./lib",
"baseUrl": "./",
"incremental": true,
"strict": true,
"noImplicitAny": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
},
"include": ["src/**/*", "__tests__/**/*", "types/**/*"],
"ts-node": {
"transpileOnly": true,
"files": true
},
"exclude": ["./coverage", "./lib", "__tests__", "jest.config.js"]
}

0 comments on commit 6e98f3f

Please sign in to comment.