Skip to content

Commit

Permalink
remote tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed Sep 18, 2021
1 parent 325232e commit 9c0e64e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ Add the following config to `.vscode/settings.json` to enable linting TypeScript

## HISTORY

### main
### main v0.15 (Sep 18, 2021)

1. Clean TSLint...

### v0.14

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chatie/eslint-config",
"version": "0.14.6",
"version": "0.15.0",
"description": "ESLint Sharable Configurations and Rules in Chatie Organization",
"main": "./src/eslintrc.cjs",
"scripts": {
Expand Down Expand Up @@ -48,7 +48,6 @@
"glob": "^7.1.7",
"markdownlint-cli": "^0.28.1",
"pkg-up": "^3.1.0",
"tslint": "^6.1.3",
"tstest": "^0.4.10",
"typescript": "^4.4.3"
},
Expand Down
2 changes: 2 additions & 0 deletions scripts/npm-pack-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ npm install --production \
@types/node \
@chatie/tsconfig \
blue-tape \
eslint \
eslint-plugin-promise \
glob \
typescript

Expand Down
2 changes: 2 additions & 0 deletions src/eslint-rules.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const ESLINT_RULES = {
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-useless-constructor': 'off',
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'comma-dangle': ['error', 'always-multiline'],
Expand Down
6 changes: 3 additions & 3 deletions src/eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { ESLINT_RULES } = require('./eslint-rules.cjs')
const { TSLINT_CONFIG } = require('./tslint-config.cjs')
// const { TSLINT_CONFIG } = require('./tslint-config.cjs')

const rules = {
...ESLINT_RULES,
'@typescript-eslint/tslint/config': ['error', TSLINT_CONFIG],
// '@typescript-eslint/tslint/config': ['error', TSLINT_CONFIG],
}

const ESLINT_RC = {
Expand All @@ -29,7 +29,7 @@ const ESLINT_RC = {
},
plugins: [
'@typescript-eslint',
'@typescript-eslint/tslint',
// '@typescript-eslint/tslint',
'promise',
],
rules,
Expand Down
3 changes: 0 additions & 3 deletions tests/detect-patterns.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ const cli = new ESLint({
useEslintrc: false,
})

// const TSLINT_JSON_FILE = path.join(__dirname, '..', 'tslint.json')
// const TSCONFIG_JSON_FILE = path.join(__dirname, '..', 'tsconfig.json')

const ANTI_PATTERNS_DIR = path.join(__dirname, 'fixtures/anti-patterns')
const GOOD_PATTERNS_DIR = path.join(__dirname, 'fixtures/good-patterns')

Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/good-patterns/brace-style.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* https://stackoverflow.com/q/64089216/1123955
*/
const n = 42
const n = Math.random() * 100

if (n === 42) { console.info(n) } else {
if (n > 42) { console.info(n) } else {
console.info(n + 1)
}

0 comments on commit 9c0e64e

Please sign in to comment.