Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move samples and template from TSLint to ESLint #561

Merged
merged 15 commits into from Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/cli/src/generate/generators/app/create-app.spec.ts
Expand Up @@ -191,7 +191,7 @@ describe('createApp', () => {
.validateSpec('tsconfig.migrations.json')
.validateSpec('tsconfig.scripts.json')
.validateSpec('tsconfig.test.json')
.validateSpec('tslint.json');
.validateSpec('.eslintrc.js');
});
it('should render the root templates (YAML option).', async () => {
await createApp({ name: 'test-fooBar', yaml: true });
Expand All @@ -207,7 +207,7 @@ describe('createApp', () => {
.validateSpec('tsconfig.migrations.json')
.validateSpec('tsconfig.scripts.json')
.validateSpec('tsconfig.test.json')
.validateSpec('tslint.json');
.validateSpec('.eslintrc.js');
});

it('should render the root templates (MongoDB option).', async () => {
Expand All @@ -224,7 +224,7 @@ describe('createApp', () => {
.shouldNotExist('tsconfig.migrations.json')
.validateSpec('tsconfig.scripts.json')
.validateSpec('tsconfig.test.json')
.validateSpec('tslint.json');
.validateSpec('.eslintrc.js');
});

it('should render the root templates (MongoDB & YAML options).', async () => {
Expand All @@ -241,7 +241,7 @@ describe('createApp', () => {
.shouldNotExist('tsconfig.migrations.json')
.validateSpec('tsconfig.scripts.json')
.validateSpec('tsconfig.test.json')
.validateSpec('tslint.json');
.validateSpec('.eslintrc.js');
});

});
2 changes: 1 addition & 1 deletion packages/cli/src/generate/generators/app/create-app.ts
Expand Up @@ -106,7 +106,7 @@ export async function createApp({ name, autoInstall, initRepo, mongodb = false,
.copyFileFromTemplatesOnlyIf(!mongodb, 'tsconfig.migrations.json')
.copyFileFromTemplates('tsconfig.scripts.json')
.copyFileFromTemplates('tsconfig.test.json')
.copyFileFromTemplates('tslint.json')
.copyFileFromTemplates('.eslintrc.js')
// Config
.mkdirIfDoesNotExist('config')
.renderTemplateOnlyIf(!mongodb && !yaml, 'config/default.json', locals)
Expand Down
43 changes: 43 additions & 0 deletions packages/cli/src/generate/specs/app/.eslintrc.js
@@ -0,0 +1,43 @@
module.exports = {
'env': {
'browser': true,
'es6': true,
'node': true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'project': 'tsconfig.json',
'sourceType': 'module'
},
'plugins': [
'@typescript-eslint'
],
'rules': {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error', { 'accessibility': 'no-public' }
],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-empty-function': 'off',
fer22f marked this conversation as resolved.
Show resolved Hide resolved
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/quotes': ['error', 'single'],
'arrow-parens': ['error', 'as-needed'],
'max-classes-per-file': 'off',
'no-console': 'off',
'no-duplicate-imports': 'error',
'no-empty': 'off',
'no-shadow': 'off',
'comma-dangle': 'off',
'sort-keys': 'off',
'@typescript-eslint/no-unused-vars': ['error', { 'args': 'none' }],
fer22f marked this conversation as resolved.
Show resolved Hide resolved
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/require-await': 'off'
fer22f marked this conversation as resolved.
Show resolved Hide resolved
}
};
14 changes: 6 additions & 8 deletions packages/cli/src/generate/specs/app/package.json
Expand Up @@ -8,24 +8,20 @@
"start": "node ./build/index.js",
"start:w": "supervisor -w ./build --no-restart-on error ./build/index.js",
"develop": "npm run build:app && concurrently \"npm run build:app:w\" \"npm run start:w\"",

"build:test": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.test.json",
"build:test:w": "tsc -p tsconfig.test.json -w",
"start:test": "mocha --file \"./build/test.js\" \"./build/**/*.spec.js\"",
"start:test:w": "mocha --file \"./build/test.js\" -w \"./build/**/*.spec.js\"",
"test": "npm run build:test && concurrently \"npm run build:test:w\" \"npm run start:test:w\"",

"build:e2e": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.e2e.json",
"build:e2e:w": "tsc -p tsconfig.e2e.json -w",
"start:e2e": "mocha --file \"./build/e2e.js\" \"./build/e2e/**/*.js\"",
"start:e2e:w": "mocha --file \"./build/e2e.js\" -w \"./build/e2e/**/*.js\"",
"e2e": "npm run build:e2e && concurrently \"npm run build:e2e:w\" \"npm run start:e2e:w\"",

"build:scripts": "tsc -p tsconfig.scripts.json",
"build:scripts:w": "tsc -p tsconfig.scripts.json -w",

"lint": "tslint -c tslint.json -p tsconfig.json",

"lint": "eslint --ext ts src",
"lint:fix": "eslint --ext ts --fix src",
fer22f marked this conversation as resolved.
Show resolved Hide resolved
"build:migrations": "tsc -p tsconfig.migrations.json",
"migration:generate": "./node_modules/.bin/typeorm migration:generate",
"migration:run": "./node_modules/.bin/typeorm migration:run",
Expand All @@ -49,7 +45,9 @@
"mocha": "^5.2.0",
"supertest": "^3.3.0",
"supervisor": "^0.12.0",
"tslint": "^5.10.0",
"eslint": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"typescript": "~3.5.3"
}
}
}
13 changes: 6 additions & 7 deletions packages/cli/src/generate/specs/app/package.mongodb.json
Expand Up @@ -8,23 +8,20 @@
"start": "node ./build/index.js",
"start:w": "supervisor -w ./build --no-restart-on error ./build/index.js",
"develop": "npm run build:app && concurrently \"npm run build:app:w\" \"npm run start:w\"",

"build:test": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.test.json",
"build:test:w": "tsc -p tsconfig.test.json -w",
"start:test": "mocha --file \"./build/test.js\" \"./build/**/*.spec.js\"",
"start:test:w": "mocha --file \"./build/test.js\" -w \"./build/**/*.spec.js\"",
"test": "npm run build:test && concurrently \"npm run build:test:w\" \"npm run start:test:w\"",

"build:e2e": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.e2e.json",
"build:e2e:w": "tsc -p tsconfig.e2e.json -w",
"start:e2e": "mocha --file \"./build/e2e.js\" \"./build/e2e/**/*.js\"",
"start:e2e:w": "mocha --file \"./build/e2e.js\" -w \"./build/e2e/**/*.js\"",
"e2e": "npm run build:e2e && concurrently \"npm run build:e2e:w\" \"npm run start:e2e:w\"",

"build:scripts": "tsc -p tsconfig.scripts.json",
"build:scripts:w": "tsc -p tsconfig.scripts.json -w",

"lint": "tslint -c tslint.json -p tsconfig.json"
"lint": "eslint --ext ts src",
"lint:fix": "eslint --ext ts --fix src"
},
"engines": {
"node": ">=8"
Expand All @@ -44,7 +41,9 @@
"mocha": "^5.2.0",
"supertest": "^3.3.0",
"supervisor": "^0.12.0",
"tslint": "^5.10.0",
"eslint": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"typescript": "~3.5.3"
}
}
}
13 changes: 6 additions & 7 deletions packages/cli/src/generate/specs/app/package.mongodb.yaml.json
Expand Up @@ -8,23 +8,20 @@
"start": "node ./build/index.js",
"start:w": "supervisor -w ./build --no-restart-on error ./build/index.js",
"develop": "npm run build:app && concurrently \"npm run build:app:w\" \"npm run start:w\"",

"build:test": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.test.json",
"build:test:w": "tsc -p tsconfig.test.json -w",
"start:test": "mocha --file \"./build/test.js\" \"./build/**/*.spec.js\"",
"start:test:w": "mocha --file \"./build/test.js\" -w \"./build/**/*.spec.js\"",
"test": "npm run build:test && concurrently \"npm run build:test:w\" \"npm run start:test:w\"",

"build:e2e": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.e2e.json",
"build:e2e:w": "tsc -p tsconfig.e2e.json -w",
"start:e2e": "mocha --file \"./build/e2e.js\" \"./build/e2e/**/*.js\"",
"start:e2e:w": "mocha --file \"./build/e2e.js\" -w \"./build/e2e/**/*.js\"",
"e2e": "npm run build:e2e && concurrently \"npm run build:e2e:w\" \"npm run start:e2e:w\"",

"build:scripts": "tsc -p tsconfig.scripts.json",
"build:scripts:w": "tsc -p tsconfig.scripts.json -w",

"lint": "tslint -c tslint.json -p tsconfig.json"
"lint": "eslint --ext ts src",
"lint:fix": "eslint --ext ts --fix src"
},
"engines": {
"node": ">=8"
Expand All @@ -45,7 +42,9 @@
"mocha": "^5.2.0",
"supertest": "^3.3.0",
"supervisor": "^0.12.0",
"tslint": "^5.10.0",
"eslint": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"typescript": "~3.5.3"
}
}
}
14 changes: 6 additions & 8 deletions packages/cli/src/generate/specs/app/package.yaml.json
Expand Up @@ -8,24 +8,20 @@
"start": "node ./build/index.js",
"start:w": "supervisor -w ./build --no-restart-on error ./build/index.js",
"develop": "npm run build:app && concurrently \"npm run build:app:w\" \"npm run start:w\"",

"build:test": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.test.json",
"build:test:w": "tsc -p tsconfig.test.json -w",
"start:test": "mocha --file \"./build/test.js\" \"./build/**/*.spec.js\"",
"start:test:w": "mocha --file \"./build/test.js\" -w \"./build/**/*.spec.js\"",
"test": "npm run build:test && concurrently \"npm run build:test:w\" \"npm run start:test:w\"",

"build:e2e": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.e2e.json",
"build:e2e:w": "tsc -p tsconfig.e2e.json -w",
"start:e2e": "mocha --file \"./build/e2e.js\" \"./build/e2e/**/*.js\"",
"start:e2e:w": "mocha --file \"./build/e2e.js\" -w \"./build/e2e/**/*.js\"",
"e2e": "npm run build:e2e && concurrently \"npm run build:e2e:w\" \"npm run start:e2e:w\"",

"build:scripts": "tsc -p tsconfig.scripts.json",
"build:scripts:w": "tsc -p tsconfig.scripts.json -w",

"lint": "tslint -c tslint.json -p tsconfig.json",

"lint": "eslint --ext ts src",
"lint:fix": "eslint --ext ts --fix src",
"build:migrations": "tsc -p tsconfig.migrations.json",
"migration:generate": "./node_modules/.bin/typeorm migration:generate",
"migration:run": "./node_modules/.bin/typeorm migration:run",
Expand All @@ -50,7 +46,9 @@
"mocha": "^5.2.0",
"supertest": "^3.3.0",
"supervisor": "^0.12.0",
"tslint": "^5.10.0",
"eslint": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"typescript": "~3.5.3"
}
}
}
28 changes: 0 additions & 28 deletions packages/cli/src/generate/specs/app/tslint.json

This file was deleted.

43 changes: 43 additions & 0 deletions packages/cli/src/generate/templates/app/.eslintrc.js
@@ -0,0 +1,43 @@
module.exports = {
'env': {
'browser': true,
'es6': true,
'node': true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'project': 'tsconfig.json',
'sourceType': 'module'
},
'plugins': [
'@typescript-eslint'
],
'rules': {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error', { 'accessibility': 'no-public' }
],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/quotes': ['error', 'single'],
'arrow-parens': ['error', 'as-needed'],
'max-classes-per-file': 'off',
'no-console': 'off',
'no-duplicate-imports': 'error',
'no-empty': 'off',
'no-shadow': 'off',
'comma-dangle': 'off',
'sort-keys': 'off',
'@typescript-eslint/no-unused-vars': ['error', { 'args': 'none' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/require-await': 'off'
}
};
14 changes: 6 additions & 8 deletions packages/cli/src/generate/templates/app/package.json
Expand Up @@ -8,24 +8,20 @@
"start": "node ./build/index.js",
"start:w": "supervisor -w ./build --no-restart-on error ./build/index.js",
"develop": "npm run build:app && concurrently \"npm run build:app:w\" \"npm run start:w\"",

"build:test": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.test.json",
"build:test:w": "tsc -p tsconfig.test.json -w",
"start:test": "mocha --file \"./build/test.js\" \"./build/**/*.spec.js\"",
"start:test:w": "mocha --file \"./build/test.js\" -w \"./build/**/*.spec.js\"",
"test": "npm run build:test && concurrently \"npm run build:test:w\" \"npm run start:test:w\"",

"build:e2e": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.e2e.json",
"build:e2e:w": "tsc -p tsconfig.e2e.json -w",
"start:e2e": "mocha --file \"./build/e2e.js\" \"./build/e2e/**/*.js\"",
"start:e2e:w": "mocha --file \"./build/e2e.js\" -w \"./build/e2e/**/*.js\"",
"e2e": "npm run build:e2e && concurrently \"npm run build:e2e:w\" \"npm run start:e2e:w\"",

"build:scripts": "tsc -p tsconfig.scripts.json",
"build:scripts:w": "tsc -p tsconfig.scripts.json -w",

"lint": "tslint -c tslint.json -p tsconfig.json",

"lint": "eslint --ext ts src",
"lint:fix": "eslint --ext ts --fix src",
"build:migrations": "tsc -p tsconfig.migrations.json",
"migration:generate": "./node_modules/.bin/typeorm migration:generate",
"migration:run": "./node_modules/.bin/typeorm migration:run",
Expand All @@ -49,7 +45,9 @@
"mocha": "^5.2.0",
"supertest": "^3.3.0",
"supervisor": "^0.12.0",
"tslint": "^5.10.0",
"eslint": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"typescript": "~3.5.3"
}
}
}
13 changes: 6 additions & 7 deletions packages/cli/src/generate/templates/app/package.mongodb.json
Expand Up @@ -8,23 +8,20 @@
"start": "node ./build/index.js",
"start:w": "supervisor -w ./build --no-restart-on error ./build/index.js",
"develop": "npm run build:app && concurrently \"npm run build:app:w\" \"npm run start:w\"",

"build:test": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.test.json",
"build:test:w": "tsc -p tsconfig.test.json -w",
"start:test": "mocha --file \"./build/test.js\" \"./build/**/*.spec.js\"",
"start:test:w": "mocha --file \"./build/test.js\" -w \"./build/**/*.spec.js\"",
"test": "npm run build:test && concurrently \"npm run build:test:w\" \"npm run start:test:w\"",

"build:e2e": "copy-cli \"src/**/*.html\" build && tsc -p tsconfig.e2e.json",
"build:e2e:w": "tsc -p tsconfig.e2e.json -w",
"start:e2e": "mocha --file \"./build/e2e.js\" \"./build/e2e/**/*.js\"",
"start:e2e:w": "mocha --file \"./build/e2e.js\" -w \"./build/e2e/**/*.js\"",
"e2e": "npm run build:e2e && concurrently \"npm run build:e2e:w\" \"npm run start:e2e:w\"",

"build:scripts": "tsc -p tsconfig.scripts.json",
"build:scripts:w": "tsc -p tsconfig.scripts.json -w",

"lint": "tslint -c tslint.json -p tsconfig.json"
"lint": "eslint --ext ts src",
"lint:fix": "eslint --ext ts --fix src"
},
"engines": {
"node": ">=8"
Expand All @@ -44,7 +41,9 @@
"mocha": "^5.2.0",
"supertest": "^3.3.0",
"supervisor": "^0.12.0",
"tslint": "^5.10.0",
"eslint": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"typescript": "~3.5.3"
}
}
}