Skip to content

Instantly share code, notes, and snippets.

@tranvansang
Last active July 29, 2019 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tranvansang/c0173a9e6f4c67bf96b5de9fad3df138 to your computer and use it in GitHub Desktop.
Save tranvansang/c0173a9e6f4c67bf96b5de9fad3df138 to your computer and use it in GitHub Desktop.
Configuration
{
"extends": [
"airbnb-base",
"eslint:recommended",
"plugin:react/recommended"
],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
},
"react": {
"version": "detect"
}
},
"env": {
"node": true,
"es6": true,
"browser": true,
"jest": true
},
"plugins": [
"react",
"babel",
"jest",
"react-hooks"
],
"rules": {
"no-irregular-whitespace": "off",
"comma-dangle": "off",
"function-paren-newline": "off",
"no-param-reassign": "off",
"semi": ["error", "never"],
"react/display-name": "off",
"react/prop-types": "off",
"import/first": "off",
"import/order": "off",
"import/prefer-default-export": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"object-curly-spacing": "off",
"padded-blocks": "off",
"spaced-comment": "off",
"radix": "off",
"no-restricted-globals": "off",
"curly": "off",
"lines-between-class-members": "off",
"object-curly-newline": "off",
"consistent-return": "off",
"max-len": ["error", {"code": 120}],
"arrow-parens": ["error", "as-needed"],
"no-async-promise-executor": "off",
"no-confusing-arrow": "off",
"no-nested-ternary": "off",
"no-return-assign": "off",
"no-restricted-syntax": "off",
"no-underscore-dangle": "off",
"no-floating-decimal": "off",
"prefer-destructuring": "off",
"no-mixed-operators": "off"
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"legacyDecorators": true
}
},
"globals": {
}
}
{
"compilerOptions": {
/* Basic Options */
"target": "esnext",
/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
"module": "esnext",
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": [
"esnext",
"dom"
],
/* Specify library files to be included in the compilation: */
"allowJs": true,
/* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
"jsx": "react",
/* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
// "outDir": "./", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "removeComments": true, /* Do not emit comments to output. */
"noEmit": true,
/* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
"isolatedModules": false,
/* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true,
/* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
"noUnusedLocals": true, /* Report errors on unused locals. */
"noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
"moduleResolution": "node",
/* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
"types": [
"node",
"jest"
],
/* Type declaration files to be included in compilation. */
"allowSyntheticDefaultImports": true,
/* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
/* Source Map Options */
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
"experimentalDecorators": true,
/* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
// Import non-ES modules as default imports.
"esModuleInterop": true,
"resolveJsonModule": true
},
"include": [
"src/**/*.ts",
"src/**/*.tsx"
],
"exclude": [
"node_modules/**"
]
}
{
"extends": [
"tslint:recommended"
// "tslint-react"
],
"linterOptions": {
"exclude": [
"node_modules/**",
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)"
]
},
"rules": {
// default recommended
"adjacent-overload-signatures": true,
"array-type": {
"options": [
"array-simple"
]
},
"arrow-return-shorthand": true,
"ban-types": {
"options": [
[
"Object",
"Avoid using the `Object` type. Did you mean `object`?"
],
[
"Function",
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
],
[
"Boolean",
"Avoid using the `Boolean` type. Did you mean `boolean`?"
],
[
"Number",
"Avoid using the `Number` type. Did you mean `number`?"
],
[
"String",
"Avoid using the `String` type. Did you mean `string`?"
],
[
"Symbol",
"Avoid using the `Symbol` type. Did you mean `symbol`?"
]
]
},
"callable-types": true,
"class-name": true,
"comment-format": false,
"curly": false,
"cyclomatic-complexity": false,
"eofline": true,
"forin": true,
"import-spacing": true,
"indent": {
"options": [
"spaces"
]
},
"interface-name": {
"options": [
"always-prefix"
]
},
"interface-over-type-literal": true,
"jsdoc-format": true,
"label-position": true,
"member-ordering": {
"options": {
"order": "statics-first"
}
},
"new-parens": true,
"no-angle-bracket-type-assertion": true,
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": false,
"no-console": true,
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty-interface": true,
"no-eval": true,
"no-internal-module": true,
"no-invalid-this": false,
"no-misused-new": true,
"no-namespace": true,
"no-parameter-properties": false,
"no-reference": true,
"no-reference-import": true,
"no-string-literal": true,
"no-string-throw": true,
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unsafe-finally": true,
"no-unused-expression": true,
"no-use-before-declare": false,
"no-var-keyword": true,
"no-var-requires": true,
"object-literal-shorthand": true,
"object-literal-sort-keys": false,
"one-line": false,
"only-arrow-functions": {
"options": [
"allow-declarations",
"allow-named-functions"
]
},
"ordered-imports": false,
"prefer-for-of": true,
"quotemark": {
"options": [
"single",
"avoid-escape",
"jsx-double"
]
},
"semicolon": {
"options": [
"never"
]
},
"trailing-comma": [
false,
{
"esSpecCompliant": true,
"multiline": "always",
"singleline": "never"
}
],
"triple-equals": {
"options": [
"allow-null-check"
]
},
"typedef": false,
"typedef-whitespace": {
"options": [
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
]
},
"typeof-compare": false,
"unified-signatures": true,
"use-isnan": true,
"whitespace": false ,
"type-literal-delimiter": false,
// self defined
"align": false,
"arrow-parens": false,
"max-classes-per-file": false,
"max-line-length": false,
"member-access": false,
"no-empty": [true, "allow-empty-functions"],
"no-shadowed-variable": false,
"object-literal-key-quotes": false,
"one-variable-per-declaration": false,
"prefer-const": [true, {"destructuring": "all"}],
"radix": false,
"space-before-function-paren": false,
"variable-name": false
},
"jsRules": {
// default recommended
"class-name": true,
"eofline": true,
"forin": true,
"import-spacing": true,
"indent": {
"options": [
"spaces"
]
},
"jsdoc-format": true,
"label-position": true,
"new-parens": true,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": false,
"no-console": true,
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-duplicate-variable": true,
"no-eval": true,
"no-reference": true,
"no-string-literal": true,
"no-string-throw": true,
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-use-before-declare": false,
"object-literal-sort-keys": false,
"one-line": false,
"quotemark": {
"options": [
"single",
"avoid-escape",
"jsx-double"
]
},
"semicolon": {
"options": [
"never"
]
},
"trailing-comma": [
false,
{
"multiline": "always",
"singleline": "never"
}
],
"triple-equals": {
"options": [
"allow-null-check"
]
},
"use-isnan": true,
"whitespace": false,
"type-literal-delimiter": false,
// self defined
"align": false,
"curly": false,
"max-line-length": false,
"no-empty": [true, "allow-empty-functions"],
"no-shadowed-variable": false,
"one-variable-per-declaration": false,
"radix": false,
"space-before-function-paren": false,
"variable-name": false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment