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 ts = require('gulp-typescript');
const del = require('delete');
var tslint = require('gulp-tslint');
const eslint = require('gulp-eslint');
const nodemon = require('gulp-nodemon');
/**
* Clears the dist folder by deleting all files inside.
@ -32,26 +32,35 @@ function moveRemaining() {
.pipe(dest('dist'));
}
function runTSlint(){
src('src/**/*.ts')
.pipe(tslint({
formatter: "verbose"
}))
.pipe(tslint.report())
function runEslint() {
return src(['scripts/*.js'])
// eslint() attaches the lint output to the "eslint" property
// of the file object so it can be used by other modules.
.pipe(eslint())
// 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("tslint", () =>
src('src/**/*.ts')
.pipe(tslint({
formatter: "verbose"
}))
.pipe(tslint.report())
);
task('eslint', () => {
return src(['scripts/*.js'])
// eslint() attaches the lint output to the "eslint" property
// of the file object so it can be used by other modules.
.pipe(eslint())
// 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('default', series(clearDist, compileTypescript, moveRemaining));
task('watch', () => {
watch('**/*.ts', runTSlint);
watch('**/*.ts', runEslint);
watch('**/*.ts', compileTypescript);
watch(['src/**/*', '!src/**/*.ts'], moveRemaining());
nodemon({

1955
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -12,12 +12,19 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.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-eslint": "^6.0.0",
"gulp-nodemon": "^2.5.0",
"gulp-tslint": "^8.1.4",
"gulp-typescript": "^6.0.0-alpha.1",
"tslint": "^6.1.3",
"typescript": "^4.0.2"
},
"dependencies": {

@ -21,7 +21,13 @@ type CargoBike {
TODO: Should this be calles Security?
"""
security: Security
"""
Does not refere to an extra table in the database.
"""
technicalEquipment: TechnicalEquipment
"""
Does not refere to an extra table in the database.
"""
dimensionsAndLoad: DimensionsAndLoad
events: [BikeEvent]
equipment: [Equipment]
@ -32,8 +38,23 @@ type CargoBike {
stickerBikeNameState: StickerBikeNameState
note: String
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{
KL
LI
@ -230,11 +251,11 @@ type ContactInformation {
type Organisation{
id: ID!
vereinsregisternr: Int
"registration number of association"
associationNo: String
}
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