gulpfile.js: migrated form tslint to eslint.

pull/1/head
leonnicolas 4 years ago
parent 9aa94a33ce
commit fa323d414f
No known key found for this signature in database
GPG Key ID: 088D0743E2B65C07

@ -1,7 +1,7 @@
const {src, dest, watch, series, task} = require('gulp'); const {src, dest, watch, series, task} = require('gulp');
const ts = require('gulp-typescript'); const ts = require('gulp-typescript');
const del = require('delete'); const del = require('delete');
var tslint = require('gulp-tslint'); const eslint = require('gulp-eslint');
const nodemon = require('gulp-nodemon'); const nodemon = require('gulp-nodemon');
/** /**
* Clears the dist folder by deleting all files inside. * Clears the dist folder by deleting all files inside.
@ -32,26 +32,35 @@ function moveRemaining() {
.pipe(dest('dist')); .pipe(dest('dist'));
} }
function runTSlint(){ function runEslint() {
src('src/**/*.ts') return src(['scripts/*.js'])
.pipe(tslint({ // eslint() attaches the lint output to the "eslint" property
formatter: "verbose" // of the file object so it can be used by other modules.
})) .pipe(eslint())
.pipe(tslint.report()) // eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failAfterError last.
.pipe(eslint.failAfterError());
} }
task('eslint', () => {
task("tslint", () => return src(['scripts/*.js'])
src('src/**/*.ts') // eslint() attaches the lint output to the "eslint" property
.pipe(tslint({ // of the file object so it can be used by other modules.
formatter: "verbose" .pipe(eslint())
})) // eslint.format() outputs the lint results to the console.
.pipe(tslint.report()) // Alternatively use eslint.formatEach() (see Docs).
); .pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failAfterError last.
.pipe(eslint.failAfterError());
});
task('default', series(clearDist, compileTypescript, moveRemaining)); task('default', series(clearDist, compileTypescript, moveRemaining));
task('watch', () => { task('watch', () => {
watch('**/*.ts', runTSlint); watch('**/*.ts', runEslint);
watch('**/*.ts', compileTypescript); watch('**/*.ts', compileTypescript);
watch(['src/**/*', '!src/**/*.ts'], moveRemaining()); watch(['src/**/*', '!src/**/*.ts'], moveRemaining());
nodemon({ nodemon({

2095
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -12,12 +12,19 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"delete": "^1.1.0", "delete": "^1.1.0",
"eslint": "^7.8.1",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-eslint": "^6.0.0",
"gulp-nodemon": "^2.5.0", "gulp-nodemon": "^2.5.0",
"gulp-tslint": "^8.1.4",
"gulp-typescript": "^6.0.0-alpha.1", "gulp-typescript": "^6.0.0-alpha.1",
"tslint": "^6.1.3",
"typescript": "^4.0.2" "typescript": "^4.0.2"
}, },
"dependencies": { "dependencies": {

@ -21,7 +21,13 @@ type CargoBike {
TODO: Should this be calles Security? TODO: Should this be calles Security?
""" """
security: Security security: Security
"""
Does not refere to an extra table in the database.
"""
technicalEquipment: TechnicalEquipment technicalEquipment: TechnicalEquipment
"""
Does not refere to an extra table in the database.
"""
dimensionsAndLoad: DimensionsAndLoad dimensionsAndLoad: DimensionsAndLoad
events: [BikeEvent] events: [BikeEvent]
equipment: [Equipment] equipment: [Equipment]
@ -32,8 +38,23 @@ type CargoBike {
stickerBikeNameState: StickerBikeNameState stickerBikeNameState: StickerBikeNameState
note: String note: String
provider: Provider provider: Provider
coordinator: Coordinator
insuranceData: InsuranceData
} }
type InsuranceData {
"""
Eventuelly, this field will become an enum or a seperate data table and user can choose from a pool of insurance companies.
"""
name: String
}
type Coordinator {
id:ID!
contactInformation: ContactInformation!
note: String
corgoBikes: [CargoBike]!
}
enum Group{ enum Group{
KL KL
LI LI
@ -230,11 +251,11 @@ type ContactInformation {
type Organisation{ type Organisation{
id: ID! id: ID!
"registration number of association"
vereinsregisternr: Int associationNo: String
} }
type Query { type Query {
cargobike(id:ID!): CargoBike cargobike(token:String!,id:ID!): CargoBike
} }
`; `;

@ -1,39 +0,0 @@
{
"extends": "tslint:recommended",
"rulesDirectory": [],
"rules": {
"max-line-length": {
"options": [120]
},
"new-parens": true,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": false,
"cyclomatic-complexity": true,
"semicolon": true,
"indent": [true, "spaces", 4],
"no-shadowed-variable": true,
"no-console": {
"severity": "warning",
"options": ["debug", "info", "log", "time", "timeEnd", "trace"]
},
"no-namespace": false,
"no-internal-module": false,
"max-classes-per-file": false,
"no-var-requires": false,
"jsdoc-format": [true, "check-multiline-start"],
"completed-docs": [true, "classes", "enums", "methods", {
"properties": {
"privacies": "all",
"locations": "instance"
}
}]
},
"jsRules": {
"max-line-length": {
"options": [120]
}
}
}
Loading…
Cancel
Save