diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..b961a14 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,8 @@ + +const rules = { +} + +module.exports = { + extends: '@chatie', + rules, +} diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..f12a6b8 --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,92 @@ +name: NPM + +on: [push, pull_request] + +jobs: + build: + name: Build + strategy: + matrix: + os: + - ubuntu-latest + # - macos-latest + node: + - 16 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + + - name: Install Dependencies + run: npm install + + - name: Test + run: npm test + + pack: + name: Pack + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + + - name: Install Dependencies + run: npm install + + - name: Generate Version + run: ./scripts/generate-version.sh + + - name: Pack Testing + run: ./scripts/npm-pack-testing.sh + + publish: + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v')) + name: Publish + needs: [build, pack] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + + - name: Install Dependencies + run: npm install + + - name: Generate Version + run: ./scripts/generate-version.sh + + - name: Set Publish Config + run: ./scripts/package-publish-config-tag.sh + + - name: Build Dist + run: npm run dist + + - name: Check Branch + id: check-branch + run: | + if [[ ${{ github.ref }} =~ ^refs/heads/(main|v[0-9]+\.[0-9]+.*)$ ]]; then + echo ::set-output name=match::true + fi # See: https://stackoverflow.com/a/58869470/1123955 + - name: Is A Publish Branch + if: steps.check-branch.outputs.match == 'true' + run: | + NAME=$(npx pkg-jq -r .name) + VERSION=$(npx pkg-jq -r .version) + if npx version-exists "$NAME" "$VERSION" + then echo "$NAME@$VERSION exists on NPM, skipped." + else npm publish + fi + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Is Not A Publish Branch + if: steps.check-branch.outputs.match != 'true' + run: echo 'Not A Publish Branch' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index be0d568..0000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -language: node_js -node_js: - - "9" - - "10" - -os: - - linux - -cache: - directories: - - node_modules - -script: - - echo $TRAVIS_OS_NAME - - node --version - - npm --version - - echo "Testing started ..." - - npm test || travis_terminate 1 - -stages: - - test - - pack - - name: deploy - if: (type = push) AND branch =~ ^(master|v\d+\.\d+)$ - -jobs: - include: - - stage: pack - script: - - npm run test:pack && echo 'Npm pack testing is passed' - - - stage: deploy - script: - - echo "Deploying to NPM ..." - - npm version - - if ./scripts/development-release.ts; then ./scripts/package-publish-config-tag-next.ts; fi - - npm run dist - - before_deploy: - - cd dist/ - - deploy: - provider: npm - email: zixia@zixia.net - api_key: "$NPM_TOKEN" - skip_cleanup: true - on: - all_branches: true - -notifications: - email: - on_success: change - on_failure: change diff --git a/README.md b/README.md index 0d81134..36b47e8 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,11 @@ It seems useless at first, but if you want to use manage many Child Class for a ## CHANGELOG +### master v0.9 (Aug 26, 2021) + +1. ESM Support +2. GitHub Action enabled + ### v0.6 (May 2018) 1. add new function: `instanceToClass()` for getting back the `Class` from an existing `instance`. diff --git a/examples/example.ts b/examples/example.ts index 280f6db..00e20b1 100644 --- a/examples/example.ts +++ b/examples/example.ts @@ -1,25 +1,27 @@ -// tslint:disable:variable-name -import * as assert from 'assert' +// eslint disable lowerCamelCase +import assert from 'assert' import { cloneClass, instanceToClass, -} from '../src/' +} from '../src/mod' class Employee { + public static company: string - constructor( + constructor ( public name: string, ) { } - public info() { - console.log(`Employee ${this.name}, Company ${(this.constructor as any).company}`) + public info () { + console.info(`Employee ${this.name}, Company ${(this.constructor as any).company}`) } + } -console.log(` +console.info(` # Example 1: cloneClass() `) @@ -37,7 +39,7 @@ employeeGg.info() employeeMs.info() // Output: Employee Jerry, Company Microsoft -console.log(` +console.info(` # Example 2: instanceToClass() `) @@ -49,4 +51,4 @@ const anotherEmployee = new RestoreGoogleEmployee('Mary') anotherEmployee.info() // Output: Employee Mary, Company Google -console.log() +console.info() diff --git a/package.json b/package.json index 0bd3fd1..893ff4d 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,28 @@ { "name": "clone-class", - "version": "0.7.3", + "version": "0.9.2", "description": "Clone an ES6 Class as Another Class Name for Isolating Class Static Properties.", - "main": "src/index.js", - "typings": "src/index.d.ts", + "type": "module", + "exports": { + ".": { + "import": "./dist/esm/src/mod.js", + "require": "./dist/cjs/src/mod.js" + } + }, + "typings": "./dist/esm/src/mod.d.ts", + "engines": { + "node": ">=14" + }, "scripts": { "clean": "shx rm -fr dist/*", - "dist": "npm run clean && tsc && shx cp {README.md,package.json} dist/", - "pack": "npm pack dist/", + "dist": "npm run clean && tsc && tsc -p tsconfig.cjs.json && npm run fixup && shx cp {README.md,package.json} dist/", + "fixup": "echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json", "example": "ts-node examples/example.ts", - "lint": "npm run lint:ts", - "lint:ts": "tslint --project tsconfig.json && tsc --noEmit", - "test": "npm run test:unit", - "test:unit": "blue-tape -r ts-node/register \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"", + "lint": "npm run lint:es && npm run lint:ts", + "lint:ts": "tsc --noEmit", + "lint:es": "eslint --ignore-pattern fixtures/ \"src/**/*.ts\" \"tests/**/*.ts\"", + "test": "npm run lint && npm run test:unit", + "test:unit": "tap --node-arg=--loader=ts-node/esm \"src/**/*.spec.ts\" \"tests/**/*.spec.ts\"", "test:pack": "bash -x scripts/npm-pack-testing.sh" }, "repository": { @@ -32,24 +42,25 @@ }, "homepage": "https://github.com/huan/clone-class#readme", "devDependencies": { - "@types/blue-tape": "^0.1.31", - "@types/semver": "^7.3.1", - "@types/node": "^15.0.0", - "blue-tape": "^1.0.0", - "git-scripts": "^0.4.3", + "@chatie/eslint-config": "^0.13.5", + "@chatie/git-scripts": "^0.6.2", + "@chatie/tsconfig": "^0.17.2", "semver": "^7.3.2", "shx": "^0.3.0", - "ts-node": "^9.0.0", - "tslint": "^6.1.2", - "typescript": "^4.0.3" - }, - "git": { - "scripts": { - "pre-push": "./scripts/pre-push.sh" - } + "tstest": "^0.5.16", + "typescript": "^4.3" }, "publishConfig": { "access": "public", "tag": "latest" + }, + "files": [ + "dist", + "src" + ], + "git": { + "scripts": { + "pre-push": "npx git-scripts-pre-push" + } } } diff --git a/scripts/development-release.ts b/scripts/development-release.ts deleted file mode 100755 index d030fa9..0000000 --- a/scripts/development-release.ts +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env ts-node -import { minor } from 'semver' - -const version: string = require('../package.json').version - -if (minor(version) % 2 === 0) { // production release - console.log(`${version} is production release`) - process.exit(1) // exit 1 for not development -} - -// development release -console.log(`${version} is development release`) -process.exit(0) diff --git a/scripts/generate-version.sh b/scripts/generate-version.sh new file mode 100755 index 0000000..a4b2706 --- /dev/null +++ b/scripts/generate-version.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -e + +SRC_VERSION_TS_FILE='src/version.ts' + +[ -f ${SRC_VERSION_TS_FILE} ] || { + echo ${SRC_VERSION_TS_FILE}" not found" + exit 1 +} + +VERSION=$(npx pkg-jq -r .version) + +cat <<_SRC_ > ${SRC_VERSION_TS_FILE} +/** + * This file was auto generated from scripts/generate-version.sh + */ +export const VERSION: string = '${VERSION}' +_SRC_ + +echo "$VERSION generated." diff --git a/scripts/npm-pack-testing.sh b/scripts/npm-pack-testing.sh index 390577a..aa900e5 100755 --- a/scripts/npm-pack-testing.sh +++ b/scripts/npm-pack-testing.sh @@ -2,9 +2,7 @@ set -e npm run dist -# must use `dist/` instead of `dist` -# or npm will re-pack a npm module named `dist` from npmjs.com -npm run pack +npm pack TMPDIR="/tmp/npm-pack-testing.$$" mkdir "$TMPDIR" @@ -12,15 +10,48 @@ mv *-*.*.*.tgz "$TMPDIR" cp tests/fixtures/smoke-testing.ts "$TMPDIR" cd $TMPDIR + npm init -y npm install *-*.*.*.tgz \ @types/node \ - typescript \ + typescript@latest + +# +# CommonJS +# +./node_modules/.bin/tsc \ + --esModuleInterop \ + --lib esnext \ + --noEmitOnError \ + --noImplicitAny \ + --skipLibCheck \ + --target es5 \ + --module CommonJS \ + --moduleResolution node \ + smoke-testing.ts + +echo +echo "CommonJS: pack testing..." +node smoke-testing.js + +# +# ES Modules +# + +# https://stackoverflow.com/a/59203952/1123955 +echo "`jq '.type="module"' package.json`" > package.json ./node_modules/.bin/tsc \ + --esModuleInterop \ --lib esnext,dom \ --noEmitOnError \ --noImplicitAny \ + --skipLibCheck \ + --target es2020 \ + --module es2020 \ + --moduleResolution node \ smoke-testing.ts +echo +echo "ES Module: pack testing..." node smoke-testing.js diff --git a/scripts/package-publish-config-tag-next.ts b/scripts/package-publish-config-tag-next.ts deleted file mode 100755 index a8dede4..0000000 --- a/scripts/package-publish-config-tag-next.ts +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ts-node -import * as fs from 'fs' -import * as path from 'path' - -const PACKAGE_JSON = path.join(__dirname, '../package.json') - -const pkg = require(PACKAGE_JSON) - -pkg.publishConfig.tag = 'next' - -fs.writeFileSync(PACKAGE_JSON, JSON.stringify(pkg, null, 2)) -// console.log(JSON.stringify(pkg, null, 2)) - -console.log('set package.json:publicConfig.tag to next.') diff --git a/scripts/package-publish-config-tag.sh b/scripts/package-publish-config-tag.sh new file mode 100755 index 0000000..0187283 --- /dev/null +++ b/scripts/package-publish-config-tag.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -e + +VERSION=$(npx pkg-jq -r .version) + +if npx --package @chatie/semver semver-is-prod $VERSION; then + npx pkg-jq -i '.publishConfig.tag="latest"' + echo "production release: publicConfig.tag set to latest." +else + npx pkg-jq -i '.publishConfig.tag="next"' + echo 'development release: publicConfig.tag set to next.' +fi + diff --git a/scripts/pre-push.sh b/scripts/pre-push.sh deleted file mode 100755 index b644331..0000000 --- a/scripts/pre-push.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". -set -e - -[ -n "$NO_HOOK" ] && exit 0 - -[ -n "$WECHATY_INNER_PRE_HOOK" ] && { - # http://stackoverflow.com/a/21334985/1123955 - exit 0 -} - -npm run lint - -[ -z "$CYGWIN" ] && { - # git rebase - rm -f package-lock.json - npm version patch --no-package-lock - WECHATY_INNER_PRE_HOOK=1 git push - - cat <<'_STR_' - ____ _ _ ____ _ - / ___(_) |_ | _ \ _ _ ___| |__ -| | _| | __| | |_) | | | / __| '_ \ -| |_| | | |_ | __/| |_| \__ \ | | | - \____|_|\__| |_| \__,_|___/_| |_| - - ____ _ _ -/ ___| _ _ ___ ___ ___ ___ __| | | -\___ \| | | |/ __/ __/ _ \/ _ \/ _` | | - ___) | |_| | (_| (_| __/ __/ (_| |_| -|____/ \__,_|\___\___\___|\___|\__,_(_) - -_STR_ - - echo - echo - echo - echo " ### Npm verion bumped and pushed by inner push inside hook pre-push ###" - echo " ------- vvvvvvv outer push will be canceled, never mind vvvvvvv -------" - echo - echo - echo - exit 127 -} - -# must run this after the above `test` ([ -z ...]), -# or will whow a error: error: failed to push some refs to 'git@github.com:wechaty/wechaty.git' -echo "PRE-PUSH HOOK PASSED" -echo - diff --git a/src/clone-class.spec.ts b/src/clone-class.spec.ts index c10a4c0..96b5d1d 100755 --- a/src/clone-class.spec.ts +++ b/src/clone-class.spec.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env ts-node +#!/usr/bin/env node --loader ts-node/esm /** * Wechaty - https://github.com/chatie/wechaty * @@ -19,12 +19,12 @@ */ // tslint:disable:variable-name -import * as test from 'blue-tape' +import { test } from 'tstest' // import * as sinon from 'sinon' -import cloneClass from './clone-class' +import cloneClass from './clone-class.js' -import FixtureClass from '../tests/fixtures/fixture-class' +import FixtureClass from '../tests/fixtures/fixture-class.js' test('cloneClass smoke testing', async t => { const EXPECTED_NUMBER1 = 1 @@ -35,8 +35,8 @@ test('cloneClass smoke testing', async t => { t.ok(NewClass1.prototype instanceof FixtureClass, 'should extend right') - t.notEqual(NewClass1, NewClass2, 'NewClass1 should different with NewClass2') - t.notEqual(NewClass1, FixtureClass, 'NewClass1 should different with FixtureClass') + t.not(NewClass1, NewClass2, 'NewClass1 should different with NewClass2') + t.not(NewClass1, FixtureClass, 'NewClass1 should different with FixtureClass') NewClass1.staticMethod(EXPECTED_NUMBER1) t.equal(NewClass1.staticNumber, EXPECTED_NUMBER1, 'should set static number to EXPECTED_NUMBER1') @@ -61,7 +61,9 @@ test('cloneClass return NewClass with Original Name', async t => { test('throw error when lowercase static property initilized with defination', async t => { class Test { - public static n = {mof: 42} + + public static n = { mof: 42 } + } t.throws(() => cloneClass(Test), 'should throw when the static property initialized with a object in defination') @@ -69,7 +71,9 @@ test('throw error when lowercase static property initilized with defination', as test('permit static property start with a captial letter to be initilized with defination', async t => { class Test { - public static Data = {mof: 42} + + public static Data = { mof: 42 } + } t.doesNotThrow(() => cloneClass(Test), 'should not throw when the static property start with a captial letter that initialized with a object in defination') diff --git a/src/clone-class.ts b/src/clone-class.ts index 4a18d4b..c4bda85 100644 --- a/src/clone-class.ts +++ b/src/clone-class.ts @@ -3,10 +3,10 @@ * Clone Class for easy savig Information into Static Properties * https://github.com/Chatie/wechaty/issues/518 */ -import Constructor from './constructor' +import Constructor from './constructor.js' // tslint:disable-next-line:variable-name -export function cloneClass>(OriginalClass: T): T { +export function cloneClass> (OriginalClass: T): T { for (const staticProperty in OriginalClass) { /** @@ -26,9 +26,11 @@ export function cloneClass>(OriginalClass: T): T { } class AnotherOriginalClass extends OriginalClass { - constructor(...args: any[]) { + + constructor (...args: any[]) { super(...args) } + } Reflect.defineProperty(AnotherOriginalClass, 'name', { diff --git a/src/config.ts b/src/config.ts index 642d723..80aad56 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,7 +1,11 @@ -export const VERSION = require('../package.json').version as string +import { VERSION } from './version.js' // // https://stackoverflow.com/a/38311757/1123955 // export type ClassConstructor = { // // new(): T // [P in keyof typeof T]: (typeof T)[P] // } + +export { + VERSION, +} diff --git a/src/constructor.spec.ts b/src/constructor.spec.ts index 0b81620..fd3f327 100755 --- a/src/constructor.spec.ts +++ b/src/constructor.spec.ts @@ -1,8 +1,8 @@ -import * as test from 'blue-tape' +import { test } from 'tstest' -import FixtureClass from '../tests/fixtures/fixture-class' +import FixtureClass from '../tests/fixtures/fixture-class.js' -import Constructor from './constructor' +import Constructor from './constructor.js' test('Constructor smoke testing', async t => { type TYPE = typeof FixtureClass & Constructor @@ -12,8 +12,7 @@ test('Constructor smoke testing', async t => { * Make sure that `PROTOTYPE` is equal to `typeof FixtureClass` * See also: https://stackoverflow.com/a/50116912/1123955 */ - let instance: PROTOTYPE - instance = new FixtureClass(1, 2) + const instance: PROTOTYPE = new FixtureClass(1, 2) t.equal(instance.sum(), 3, 'should sum right for 1 + 2') }) diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index a826508..0000000 --- a/src/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { Constructor } from './constructor' -export { VERSION } from './config' -export { instanceToClass} from './instance-to-class' - -import { cloneClass } from './clone-class' -export { cloneClass } -export default cloneClass diff --git a/src/instance-to-class.spec.ts b/src/instance-to-class.spec.ts index 30e5ac5..df755ab 100755 --- a/src/instance-to-class.spec.ts +++ b/src/instance-to-class.spec.ts @@ -1,10 +1,10 @@ -// tslint:disable:variable-name +#!/usr/bin/env node --loader ts-node/esm -import * as test from 'blue-tape' +import { test } from 'tstest' -import instanceToClass from './instance-to-class' +import instanceToClass from './instance-to-class.js' -import FixtureClass from '../tests/fixtures/fixture-class' +import FixtureClass from '../tests/fixtures/fixture-class.js' test('instanceToClass smoke testing', async t => { const instance = new FixtureClass(1, 2) diff --git a/src/instance-to-class.ts b/src/instance-to-class.ts index b1257c8..7a90838 100644 --- a/src/instance-to-class.ts +++ b/src/instance-to-class.ts @@ -1,4 +1,4 @@ -import { Constructor } from './constructor' +import { Constructor } from './constructor.js' export function instanceToClass< T extends Constructor<{}>, @@ -7,7 +7,7 @@ export function instanceToClass< instance: InstanceType, baseClass: C, ): C { - return instance.constructor as any as (typeof baseClass /* C */ ) + return instance.constructor as any as (typeof baseClass /* C */) } export default instanceToClass diff --git a/src/mod.ts b/src/mod.ts new file mode 100644 index 0000000..9522b07 --- /dev/null +++ b/src/mod.ts @@ -0,0 +1,13 @@ +import { Constructor } from './constructor.js' +import { VERSION } from './config.js' +import { instanceToClass } from './instance-to-class.js' + +import { cloneClass } from './clone-class.js' + +export { + cloneClass, + Constructor, + instanceToClass, + VERSION, +} +export default cloneClass diff --git a/src/version.spec.ts b/src/version.spec.ts new file mode 100755 index 0000000..d36741f --- /dev/null +++ b/src/version.spec.ts @@ -0,0 +1,9 @@ +#!/usr/bin/env node --loader ts-node/esm + +import { test } from 'tstest' + +import { VERSION } from './version.js' + +test('Make sure the VERSION is fresh in source code', async t => { + t.equal(VERSION, '0.0.0', 'version should be 0.0.0 in source code, only updated before publish to NPM') +}) diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 0000000..2d26f07 --- /dev/null +++ b/src/version.ts @@ -0,0 +1,7 @@ + +/** + * This file will be overwrite when we publish NPM module + * by scripts/generate_version.ts + */ + +export const VERSION = '0.0.0' diff --git a/tests/fixtures/smoke-testing.ts b/tests/fixtures/smoke-testing.ts index 6b75c2c..78e4d45 100644 --- a/tests/fixtures/smoke-testing.ts +++ b/tests/fixtures/smoke-testing.ts @@ -1,9 +1,9 @@ -const assert = require('assert') +import assert from 'assert' -const { +import { VERSION, cloneClass -} = require('clone-class') +} from 'clone-class' console.log(`VERSION v${VERSION}`) diff --git a/tests/integration.spec.ts b/tests/integration.spec.ts new file mode 100755 index 0000000..232cf31 --- /dev/null +++ b/tests/integration.spec.ts @@ -0,0 +1,7 @@ +#!/usr/bin/env node --loader ts-node/esm + +import { test } from 'tstest' + +test('tbw', async t => { + t.ok(true, 'tbw') +}) diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json new file mode 100644 index 0000000..8693cd0 --- /dev/null +++ b/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist/cjs", + }, +} diff --git a/tsconfig.json b/tsconfig.json index 6f8defc..57358d3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,39 +1,23 @@ { + "extends": "@chatie/tsconfig", "compilerOptions": { - "target": "es6" - , "module": "commonjs" - , "outDir": "dist" - , "declaration": true - , "sourceMap": true - - , "noEmitOnError": true - , "noUnusedLocals": true - , "noImplicitReturns": true - , "noFallthroughCasesInSwitch": true - , "strictNullChecks": true - , "noImplicitAny": true - , "noUnusedParameters": true - , "noImplicitThis": true - - , "noLib": false - , "traceResolution": false - , "lib": [ - "esnext" - ] - } - , "exclude": [ - "node_modules/" - , "dist/" - , "tests/fixtures/" - ] - , "include": [ - "*.ts" - , "bin/*.ts" - , "scripts/**/*.ts" - , "examples/**/*.ts" - , "src/**/*.ts" - , "tests/**/*.spec.ts" - , "bot/**/*.ts" - , "app/**/*.ts" - ] + "outDir": "dist/esm", + "target": "es2020", + "module": "es2020", + "moduleResolution": "node", + }, + "exclude": [ + "node_modules/", + "dist/", + "tests/fixtures/", + ], + "include": [ + "app/**/*.ts", + "bin/*.ts", + "bot/**/*.ts", + "examples/**/*.ts", + "scripts/**/*.ts", + "src/**/*.ts", + "tests/**/*.spec.ts", + ], } diff --git a/tslint.json b/tslint.json deleted file mode 100644 index aaabfcc..0000000 --- a/tslint.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "rulesDirectory": [ - ], - "rules": { - "align": [ - true, - "parameters", - // "arguments", - "statements" - ], - "jsdoc-require": [ - false - ], - "ban": false, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": false, - "eofline": true, - "forin": false, - "indent": [ - true, - "spaces" - ], - "interface-name": false, - "jsdoc-format": true, - "label-position": true, - "max-line-length": [ - true, - 180 - ], - "callable-types": true, - "import-blacklist": [true, "rxjs"], - "interface-over-type-literal": true, - "no-empty-interface": true, - "no-string-throw": true, - "prefer-const": true, - "unified-signatures": false, - "no-inferrable-types": [true, "ignore-params"], - "member-access": true, - "member-ordering": [false], - "no-any": false, - "no-arg": true, - "no-bitwise": true, - "no-conditional-assignment": true, - "no-consecutive-blank-lines": true, - "no-console": [false], - "no-construct": false, - "no-debugger": true, - "no-duplicate-variable": true, - "no-empty": true, - "no-eval": true, - "no-internal-module": true, - "no-require-imports": false, - "no-shadowed-variable": true, - "no-string-literal": false, - "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, - "no-unused-expression": true, - "no-unused-variable": [true], - "no-use-before-declare": true, - "no-var-keyword": true, - "no-var-requires": false, - "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "single", - "avoid-escape" - ], - "radix": false, - "semicolon": [true, "never"], - "switch-default": false, - "trailing-comma": [ - true, - { - "multiline": "always", - "singleline": "never" - } - ], - "triple-equals": [true], - "typedef": [false], - "typedef-whitespace": [ - false, - { - "call-signature": "space", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": [ - true, - "check-format", - "allow-leading-underscore", - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -}