├── .circleci └── config.yml ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .husky └── pre-commit ├── .npmignore ├── .prettierignore ├── .vscode ├── extensions.json └── settings.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DEVELOPING.md ├── LICENSE ├── MAINTAINING.md ├── README.md ├── base.js ├── index.js ├── lib └── shared.js ├── lint-staged.config.js ├── package-lock.json ├── package.json ├── prettier.config.js ├── renovate.json └── tsconfig.json /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | docker: 5 | - image: 'circleci/node:latest' 6 | steps: 7 | - checkout 8 | - run: 9 | name: install 10 | command: npm install 11 | - run: 12 | name: validate 13 | command: npm run validate 14 | - run: 15 | name: release 16 | command: echo installing semantic-release && npx -p semantic-release@15 -c 'echo running semantic-release && semantic-release' 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | 13 | [*.md] 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['eslint-config-airbnb-base', './base.js', 'prettier'], 3 | parserOptions: { 4 | project: './tsconfig.json', 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/alexkaratarakis/gitattributes/blob/master/Web.gitattributes 2 | # 3 | ## GITATTRIBUTES FOR WEB PROJECTS 4 | # 5 | # These settings are for any web project. 6 | # 7 | # Details per file setting: 8 | # text These files should be normalized (i.e. convert CRLF to LF). 9 | # binary These files are binary and should be left untouched. 10 | # 11 | # Note that binary is a macro for -text -diff. 12 | ###################################################################### 13 | 14 | ## AUTO-DETECT 15 | ## Handle line endings automatically for files detected as 16 | ## text and leave all files detected as binary untouched. 17 | ## This will handle all files NOT defined below. 18 | * text=auto 19 | 20 | ## SOURCE CODE 21 | *.bat text eol=crlf 22 | *.coffee text 23 | *.css text 24 | *.htm text 25 | *.html text 26 | *.inc text 27 | *.ini text 28 | *.js text 29 | *.json text 30 | *.jsx text 31 | *.less text 32 | *.od text 33 | *.onlydata text 34 | *.php text 35 | *.pl text 36 | *.py text 37 | *.rb text 38 | *.sass text 39 | *.scm text 40 | *.scss text 41 | *.sh text eol=lf 42 | *.sql text 43 | *.styl text 44 | *.tag text 45 | *.ts text 46 | *.tsx text 47 | *.xml text 48 | *.xhtml text 49 | 50 | ## DOCKER 51 | *.dockerignore text 52 | Dockerfile text 53 | 54 | ## DOCUMENTATION 55 | *.markdown text 56 | *.md text 57 | *.mdwn text 58 | *.mdown text 59 | *.mkd text 60 | *.mkdn text 61 | *.mdtxt text 62 | *.mdtext text 63 | *.txt text 64 | AUTHORS text 65 | CHANGELOG text 66 | CHANGES text 67 | CONTRIBUTING text 68 | COPYING text 69 | copyright text 70 | *COPYRIGHT* text 71 | INSTALL text 72 | license text 73 | LICENSE text 74 | NEWS text 75 | readme text 76 | *README* text 77 | TODO text 78 | 79 | ## TEMPLATES 80 | *.dot text 81 | *.ejs text 82 | *.haml text 83 | *.handlebars text 84 | *.hbs text 85 | *.hbt text 86 | *.jade text 87 | *.latte text 88 | *.mustache text 89 | *.njk text 90 | *.phtml text 91 | *.tmpl text 92 | *.tpl text 93 | *.twig text 94 | 95 | ## LINTERS 96 | .csslintrc text 97 | .eslintrc text 98 | .htmlhintrc text 99 | .jscsrc text 100 | .jshintrc text 101 | .jshintignore text 102 | .stylelintrc text 103 | 104 | ## CONFIGS 105 | *.bowerrc text 106 | *.cnf text 107 | *.conf text 108 | *.config text 109 | .browserslistrc text 110 | .editorconfig text 111 | .gitattributes text 112 | .gitconfig text 113 | .htaccess text 114 | *.npmignore text 115 | *.yaml text 116 | *.yml text 117 | browserslist text 118 | Makefile text 119 | makefile text 120 | 121 | ## HEROKU 122 | Procfile text 123 | .slugignore text 124 | 125 | ## GRAPHICS 126 | *.ai binary 127 | *.bmp binary 128 | *.eps binary 129 | *.gif binary 130 | *.ico binary 131 | *.jng binary 132 | *.jp2 binary 133 | *.jpg binary 134 | *.jpeg binary 135 | *.jpx binary 136 | *.jxr binary 137 | *.pdf binary 138 | *.png binary 139 | *.psb binary 140 | *.psd binary 141 | *.svg text 142 | *.svgz binary 143 | *.tif binary 144 | *.tiff binary 145 | *.wbmp binary 146 | *.webp binary 147 | 148 | ## AUDIO 149 | *.kar binary 150 | *.m4a binary 151 | *.mid binary 152 | *.midi binary 153 | *.mp3 binary 154 | *.ogg binary 155 | *.ra binary 156 | 157 | ## VIDEO 158 | *.3gpp binary 159 | *.3gp binary 160 | *.as binary 161 | *.asf binary 162 | *.asx binary 163 | *.fla binary 164 | *.flv binary 165 | *.m4v binary 166 | *.mng binary 167 | *.mov binary 168 | *.mp4 binary 169 | *.mpeg binary 170 | *.mpg binary 171 | *.ogv binary 172 | *.swc binary 173 | *.swf binary 174 | *.webm binary 175 | 176 | ## ARCHIVES 177 | *.7z binary 178 | *.gz binary 179 | *.jar binary 180 | *.rar binary 181 | *.tar binary 182 | *.zip binary 183 | 184 | ## FONTS 185 | *.ttf binary 186 | *.eot binary 187 | *.otf binary 188 | *.woff binary 189 | *.woff2 binary 190 | 191 | ## EXECUTABLES 192 | *.exe binary 193 | *.pyc binary 194 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.eslintcache 2 | /node_modules 3 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | npm run pre-commit 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | * 2 | 3 | !/base.js 4 | !/index.js 5 | !/lib/**/* 6 | 7 | !/package.json 8 | 9 | !/CHANGELOG.md 10 | !/LICENCE 11 | !/README.md 12 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /package-lock.json 3 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. 3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp 4 | 5 | // List of extensions which should be recommended for users of this workspace. 6 | "recommendations": [ 7 | "editorconfig.editorconfig", 8 | "esbenp.prettier-vscode", 9 | "dbaeumer.vscode-eslint" 10 | ], 11 | 12 | // List of extensions recommended by VS Code that should not be recommended for users of this workspace. 13 | "unwantedRecommendations": [] 14 | } 15 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "prettier.eslintIntegration": true 4 | } 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | Automatically generated (by [semantic-release](https://github.com/semantic-release/semantic-release)) on the [releases page](https://github.com/iamturns/eslint-config-airbnb-typescript/releases). 4 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | - Using welcoming and inclusive language 18 | - Being respectful of differing viewpoints and experiences 19 | - Gracefully accepting constructive criticism 20 | - Focusing on what is best for the community 21 | - Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | - The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | - Trolling, insulting/derogatory comments, and personal or political attacks 28 | - Public or private harassment 29 | - Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | - Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at matt@iamturns.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, 71 | available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html) 72 | 73 | For answers to common questions about this code of conduct, see 74 | [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). 75 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for being willing to contribute! 4 | 5 | ## Submitting Bug Reports 6 | 7 | Please use the [GitHub issue tracker](https://github.com/iamturns/eslint-config-airbnb-typescript/issues). Before creating a new issue, do a quick search to see if the problem has been reported already. 8 | 9 | ## Contributing Code 10 | 11 | See [DEVELOPING.md](DEVELOPING.md). 12 | 13 | First time contributing code to an open source project on GitHub? Learn how with this [free video tutorial](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). 14 | -------------------------------------------------------------------------------- /DEVELOPING.md: -------------------------------------------------------------------------------- 1 | # Developing 2 | 3 | ## Introduction 4 | 5 | ### How do I setup the project? 6 | 7 | 1. Fork the repo 8 | 1. Install dependencies: `npm install` 9 | 1. Ensure everything is working: `npm run validate` 10 | 11 | ### What's the workflow? 12 | 13 | 1. Create your feature branch: `git checkout -b my-new-feature` 14 | 1. Write code 15 | 1. Once complete, submit a [pull request on GitHub](https://github.com/iamturns/eslint-config-airbnb-typescript/pulls). 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © Matt Turnbull 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /MAINTAINING.md: -------------------------------------------------------------------------------- 1 | # Maintaining 2 | 3 | This guide is intended for maintainers (anybody with commit access). 4 | 5 | ## Approving Pull Requests 6 | 7 | 1. Use "Squash and Merge". This keeps a clean history in `master`, with a full history available in Pull Requests. 8 | 1. Ensure the merge message conforms to [Conventional Commits](https://conventionalcommits.org/) spec. 9 | 10 | ## Releasing 11 | 12 | Releasing is handled automatically by [CircleCI](https://circleci.com/) and [semantic-release](https://github.com/semantic-release/semantic-release). 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eslint-config-airbnb-typescript 2 | 3 | [![Version](https://img.shields.io/npm/v/eslint-config-airbnb-typescript.svg?style=flat-square)](https://www.npmjs.com/package/eslint-config-airbnb-typescript?activeTab=versions) [![Downloads](https://img.shields.io/npm/dt/eslint-config-airbnb-typescript.svg?style=flat-square)](https://www.npmjs.com/package/eslint-config-airbnb-typescript) [![Last commit](https://img.shields.io/github/last-commit/iamturns/eslint-config-airbnb-typescript.svg?style=flat-square)](https://github.com/iamturns/eslint-config-airbnb-typescript/graphs/commit-activity) [![Build](https://img.shields.io/circleci/project/github/iamturns/eslint-config-airbnb-typescript/master.svg?style=flat-square)](https://circleci.com/gh/iamturns/eslint-config-airbnb-typescript) [![License](https://img.shields.io/github/license/iamturns/eslint-config-airbnb-typescript.svg?style=flat-square)](https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/CONTRIBUTING.md) [![Code of conduct](https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square)](https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/CODE_OF_CONDUCT.md) 4 | 5 | Enhances Airbnb's ESLint config with TypeScript support 6 | 7 | --- 8 | 9 | ### 👋 This repo has been archived 10 | 11 | After six years and reaching 2 million weekly downloads, I can no longer give this project the attention it deserves. 12 | 13 | A huge thank you to all contributors along the way ❤️ 14 | 15 | ### 🔀 Alternatives 16 | 17 | - [`eslint-config-airbnb-extended`](https://www.npmjs.com/package/eslint-config-airbnb-extended) 18 | 19 | These are not personal recommendations. Just sharing for discoverability. Know other alternatives? [Email me](mailto:matt@iamturns.com). 20 | 21 | --- 22 | 23 | --- 24 | 25 | --- 26 | 27 | 28 | ## Setup 29 | 30 | ### 1) Setup regular Airbnb config 31 | 32 | Make sure you have the regular Airbnb config setup. If you are using React, use [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb), or if you aren't using React, use [eslint-config-airbnb-base](https://www.npmjs.com/package/eslint-config-airbnb-base). 33 | 34 | ### 2) Install dependencies (and peer dependencies) 35 | 36 | ```bash 37 | npm install eslint-config-airbnb-typescript \ 38 | @typescript-eslint/eslint-plugin@^7.0.0 \ 39 | @typescript-eslint/parser@^7.0.0 \ 40 | --save-dev 41 | ``` 42 | 43 | ### 3) Configure ESLint 44 | 45 | Within your ESLint config file: 46 | 47 | ```diff 48 | extends: [ 49 | 'airbnb', 50 | + 'airbnb-typescript' 51 | ] 52 | ``` 53 | 54 | If you don't need React support: 55 | 56 | ```diff 57 | extends: [ 58 | 'airbnb-base', 59 | + 'airbnb-typescript/base' 60 | ] 61 | ``` 62 | 63 | ### 4) Configure the ESLint TypeScript parser 64 | 65 | This config requires knowledge of your TypeScript config. 66 | 67 | In your ESLint config, set [parserOptions.project](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsproject) to the path of your `tsconfig.json`. 68 | 69 | For example: 70 | 71 | ```diff 72 | { 73 | extends: ['airbnb', 'airbnb-typescript'], 74 | + parserOptions: { 75 | + project: './tsconfig.json' 76 | + } 77 | } 78 | ``` 79 | 80 | ### 5) Run ESLint 81 | 82 | Open a terminal to the root of your project, and run the following command: 83 | 84 | ``` 85 | npx eslint . --ext .js,.jsx,.ts,.tsx 86 | ``` 87 | 88 | ESLint will lint all .js, .jsx, .ts, and .tsx files within the current folder, and output results to your terminal. 89 | 90 | You can also get results in realtime inside most IDEs via a plugin. 91 | 92 | ## FAQ 93 | 94 | ### I get this error when running ESLint: "The file must be included in at least one of the projects provided" 95 | 96 | This means you are attempting to lint a file that `tsconfig.json` doesn't include. 97 | 98 | A common fix is to create a `tsconfig.eslint.json` file, which extends your `tsconfig.json` file and includes all files you are linting. 99 | 100 | ```json 101 | { 102 | "extends": "./tsconfig.json", 103 | "include": ["src/**/*.ts", "src/**/*.js", "test/**/*.ts"] 104 | } 105 | ``` 106 | 107 | Update your ESLint config file: 108 | 109 | ```diff 110 | parserOptions: { 111 | - project: './tsconfig.json', 112 | + project: './tsconfig.eslint.json', 113 | } 114 | ``` 115 | 116 | ### Why do I need the peer dependencies? 117 | 118 | `@typescript-eslint/eslint-plugin` is a peer dependency due to a limitation within ESLint. See [issue](https://github.com/eslint/eslint/issues/3458), [RFC](https://github.com/eslint/rfcs/tree/master/designs/2019-config-simplification), and [progress](https://github.com/eslint/eslint/issues/13481). 119 | 120 | `@typescript-eslint/parser` is a peer dependency because the version number must match `@typescript-eslint/eslint-plugin`. 121 | 122 | ### I wish this config would support [...] 123 | 124 | This config simply enhances the Airbnb with TypeScript support. It's not a single config to cater for all TypeScript linting requirements. For additional functionality, alter your ESLint config file. For example: 125 | 126 | ```js 127 | module.exports = { 128 | extends: [ 129 | 'airbnb', 130 | 'airbnb-typescript', 131 | 'airbnb/hooks', 132 | 'plugin:@typescript-eslint/recommended-type-checked', // @typescript-eslint @v6 133 | 'plugin:@typescript-eslint/stylistic-type-checked', // @typescript-eslint @v6 134 | // 'plugin:@typescript-eslint/recommended', // @typescript-eslint @v5 135 | // 'plugin:@typescript-eslint/recommended-requiring-type-checking', // @typescript-eslint @v5 136 | ], 137 | }; 138 | ``` 139 | 140 | My personal ESLint config file with support for Jest, Promises, and Prettier can be found in [create-exposed-app](https://github.com/iamturns/create-exposed-app/blob/master/.eslintrc.js). 141 | 142 | ### Why is `import/no-unresolved` disabled? 143 | 144 | Two reasons: 145 | 146 | 1. It requires additional configuration, which may be different for monorepo's, webpack usage, etc 147 | 2. The rule offers little value in a TypeScript world, as the TypeScript compiler will catch these errors 148 | 149 | If you would like to enable this rule, then: 150 | 151 | - Enable the rule within your config: `'import/no-unresolved': 'error'` 152 | - Install and configure the TypeScript import resolver: [eslint-import-resolver-typescript](https://www.npmjs.com/package/eslint-import-resolver-typescript) 153 | 154 | ## Additional Documentation 155 | 156 | - [CHANGELOG.md](CHANGELOG.md) 157 | - [DEVELOPING.md](DEVELOPING.md) 158 | - [CONTRIBUTING.md](CONTRIBUTING.md) 159 | - [MAINTAINING.md](MAINTAINING.md) 160 | 161 | ## Credits 162 | 163 | Authored and maintained by Matt Turnbull ([iamturns.com](https://iamturns.com) / [@iamturns](https://twitter.com/iamturns)) 164 | 165 | A big thank you to all [contributors](https://github.com/iamturns/eslint-config-airbnb-typescript/graphs/contributors)! 166 | 167 | ## License 168 | 169 | Open source [licensed as MIT](https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/LICENSE). 170 | -------------------------------------------------------------------------------- /base.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['./lib/shared.js'].map(require.resolve), 3 | }; 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | // This file adds some React specific settings. Not using React? Use base.js instead. 2 | module.exports = { 3 | extends: ['./lib/shared'].map(require.resolve), 4 | settings: { 5 | // Append 'ts' extensions to Airbnb 'import/resolver' setting 6 | // Prepend 'mjs' to match shared config 7 | // Original: ['.js', '.jsx', '.json'] 8 | 'import/resolver': { 9 | node: { 10 | extensions: ['.mjs', '.js', '.jsx', '.json', '.ts', '.tsx', '.d.ts'], 11 | }, 12 | }, 13 | }, 14 | rules: { 15 | // Append 'tsx' to Airbnb 'react/jsx-filename-extension' rule 16 | // Original: ['.jsx'] 17 | 'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }], 18 | }, 19 | }; 20 | -------------------------------------------------------------------------------- /lib/shared.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-extraneous-dependencies */ 2 | const { rules: baseBestPracticesRules } = require('eslint-config-airbnb-base/rules/best-practices'); 3 | const { rules: baseErrorsRules } = require('eslint-config-airbnb-base/rules/errors'); 4 | const { rules: baseES6Rules } = require('eslint-config-airbnb-base/rules/es6'); 5 | const { rules: baseImportsRules } = require('eslint-config-airbnb-base/rules/imports'); 6 | const { rules: baseStyleRules } = require('eslint-config-airbnb-base/rules/style'); 7 | const { rules: baseVariablesRules } = require('eslint-config-airbnb-base/rules/variables'); 8 | /* eslint-enable import/no-extraneous-dependencies */ 9 | 10 | module.exports = { 11 | plugins: ['@typescript-eslint'], 12 | parser: '@typescript-eslint/parser', 13 | settings: { 14 | // Apply special parsing for TypeScript files 15 | 'import/parsers': { 16 | '@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'], 17 | }, 18 | // Append 'ts' extensions to Airbnb 'import/resolver' setting 19 | // Original: ['.mjs', '.js', '.json'] 20 | 'import/resolver': { 21 | node: { 22 | extensions: ['.mjs', '.js', '.json', '.ts', '.d.ts'], 23 | }, 24 | }, 25 | // Append 'ts' extensions to Airbnb 'import/extensions' setting 26 | // Original: ['.js', '.mjs', '.jsx'] 27 | 'import/extensions': ['.js', '.mjs', '.jsx', '.ts', '.tsx', '.d.ts'], 28 | // Resolve type definition packages 29 | 'import/external-module-folders': ['node_modules', 'node_modules/@types'], 30 | }, 31 | rules: { 32 | // Replace Airbnb 'brace-style' rule with '@typescript-eslint' version 33 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md 34 | 'brace-style': 'off', 35 | '@typescript-eslint/brace-style': baseStyleRules['brace-style'], 36 | 37 | // Replace Airbnb 'camelcase' rule with '@typescript-eslint/naming-convention' 38 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md 39 | camelcase: 'off', 40 | // The `@typescript-eslint/naming-convention` rule allows `leadingUnderscore` and `trailingUnderscore` settings. However, the existing `no-underscore-dangle` rule already takes care of this. 41 | '@typescript-eslint/naming-convention': [ 42 | 'error', 43 | // Allow camelCase variables (23.2), PascalCase variables (23.8), and UPPER_CASE variables (23.10) 44 | { 45 | selector: 'variable', 46 | format: ['camelCase', 'PascalCase', 'UPPER_CASE'], 47 | }, 48 | // Allow camelCase functions (23.2), and PascalCase functions (23.8) 49 | { 50 | selector: 'function', 51 | format: ['camelCase', 'PascalCase'], 52 | }, 53 | // Airbnb recommends PascalCase for classes (23.3), and although Airbnb does not make TypeScript recommendations, we are assuming this rule would similarly apply to anything "type like", including interfaces, type aliases, and enums 54 | { 55 | selector: 'typeLike', 56 | format: ['PascalCase'], 57 | }, 58 | ], 59 | 60 | // Replace Airbnb 'comma-dangle' rule with '@typescript-eslint' version 61 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-dangle.md 62 | // The TypeScript version also adds 3 new options, all of which should be set to the same value as the base config 63 | 'comma-dangle': 'off', 64 | '@typescript-eslint/comma-dangle': [ 65 | baseStyleRules['comma-dangle'][0], 66 | { 67 | ...baseStyleRules['comma-dangle'][1], 68 | enums: baseStyleRules['comma-dangle'][1].arrays, 69 | generics: baseStyleRules['comma-dangle'][1].arrays, 70 | tuples: baseStyleRules['comma-dangle'][1].arrays, 71 | }, 72 | ], 73 | 74 | // Replace Airbnb 'comma-spacing' rule with '@typescript-eslint' version 75 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md 76 | 'comma-spacing': 'off', 77 | '@typescript-eslint/comma-spacing': baseStyleRules['comma-spacing'], 78 | 79 | // Replace Airbnb 'default-param-last' rule with '@typescript-eslint' version 80 | // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/default-param-last.md 81 | 'default-param-last': 'off', 82 | '@typescript-eslint/default-param-last': baseBestPracticesRules['default-param-last'], 83 | 84 | // Replace Airbnb 'dot-notation' rule with '@typescript-eslint' version 85 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md 86 | 'dot-notation': 'off', 87 | '@typescript-eslint/dot-notation': baseBestPracticesRules['dot-notation'], 88 | 89 | // Replace Airbnb 'func-call-spacing' rule with '@typescript-eslint' version 90 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md 91 | 'func-call-spacing': 'off', 92 | '@typescript-eslint/func-call-spacing': baseStyleRules['func-call-spacing'], 93 | 94 | // Replace Airbnb 'indent' rule with '@typescript-eslint' version 95 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md 96 | indent: 'off', 97 | '@typescript-eslint/indent': baseStyleRules.indent, 98 | 99 | // Replace Airbnb 'keyword-spacing' rule with '@typescript-eslint' version 100 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md 101 | 'keyword-spacing': 'off', 102 | '@typescript-eslint/keyword-spacing': baseStyleRules['keyword-spacing'], 103 | 104 | // Replace Airbnb 'lines-between-class-members' rule with '@typescript-eslint' version 105 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md 106 | 'lines-between-class-members': 'off', 107 | '@typescript-eslint/lines-between-class-members': baseStyleRules['lines-between-class-members'], 108 | 109 | // Replace Airbnb 'no-array-constructor' rule with '@typescript-eslint' version 110 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md 111 | 'no-array-constructor': 'off', 112 | '@typescript-eslint/no-array-constructor': baseStyleRules['no-array-constructor'], 113 | 114 | // Replace Airbnb 'no-dupe-class-members' rule with '@typescript-eslint' version 115 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md 116 | 'no-dupe-class-members': 'off', 117 | '@typescript-eslint/no-dupe-class-members': baseES6Rules['no-dupe-class-members'], 118 | 119 | // Replace Airbnb 'no-empty-function' rule with '@typescript-eslint' version 120 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md 121 | 'no-empty-function': 'off', 122 | '@typescript-eslint/no-empty-function': baseBestPracticesRules['no-empty-function'], 123 | 124 | // Replace Airbnb 'no-extra-parens' rule with '@typescript-eslint' version 125 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md 126 | 'no-extra-parens': 'off', 127 | '@typescript-eslint/no-extra-parens': baseErrorsRules['no-extra-parens'], 128 | 129 | // Replace Airbnb 'no-extra-semi' rule with '@typescript-eslint' version 130 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md 131 | 'no-extra-semi': 'off', 132 | '@typescript-eslint/no-extra-semi': baseErrorsRules['no-extra-semi'], 133 | 134 | // Replace Airbnb 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version 135 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md 136 | 'no-implied-eval': 'off', 137 | 'no-new-func': 'off', 138 | '@typescript-eslint/no-implied-eval': baseBestPracticesRules['no-implied-eval'], 139 | 140 | // Replace Airbnb 'no-loss-of-precision' rule with '@typescript-eslint' version 141 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md 142 | 'no-loss-of-precision': 'off', 143 | '@typescript-eslint/no-loss-of-precision': baseErrorsRules['no-loss-of-precision'], 144 | 145 | // Replace Airbnb 'no-loop-func' rule with '@typescript-eslint' version 146 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md 147 | 'no-loop-func': 'off', 148 | '@typescript-eslint/no-loop-func': baseBestPracticesRules['no-loop-func'], 149 | 150 | // Replace Airbnb 'no-magic-numbers' rule with '@typescript-eslint' version 151 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md 152 | 'no-magic-numbers': 'off', 153 | '@typescript-eslint/no-magic-numbers': baseBestPracticesRules['no-magic-numbers'], 154 | 155 | // Replace Airbnb 'no-redeclare' rule with '@typescript-eslint' version 156 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md 157 | 'no-redeclare': 'off', 158 | '@typescript-eslint/no-redeclare': baseBestPracticesRules['no-redeclare'], 159 | 160 | // Replace Airbnb 'no-shadow' rule with '@typescript-eslint' version 161 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md 162 | 'no-shadow': 'off', 163 | '@typescript-eslint/no-shadow': baseVariablesRules['no-shadow'], 164 | 165 | // Replace Airbnb 'space-before-blocks' rule with '@typescript-eslint' version 166 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-blocks.md 167 | 'space-before-blocks': 'off', 168 | '@typescript-eslint/space-before-blocks': baseStyleRules['space-before-blocks'], 169 | 170 | // Replace Airbnb 'no-throw-literal' rule with '@typescript-eslint' version 171 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md 172 | 'no-throw-literal': 'off', 173 | '@typescript-eslint/no-throw-literal': baseBestPracticesRules['no-throw-literal'], 174 | 175 | // Replace Airbnb 'no-unused-expressions' rule with '@typescript-eslint' version 176 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md 177 | 'no-unused-expressions': 'off', 178 | '@typescript-eslint/no-unused-expressions': baseBestPracticesRules['no-unused-expressions'], 179 | 180 | // Replace Airbnb 'no-unused-vars' rule with '@typescript-eslint' version 181 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md 182 | 'no-unused-vars': 'off', 183 | '@typescript-eslint/no-unused-vars': baseVariablesRules['no-unused-vars'], 184 | 185 | // Replace Airbnb 'no-use-before-define' rule with '@typescript-eslint' version 186 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md 187 | 'no-use-before-define': 'off', 188 | '@typescript-eslint/no-use-before-define': baseVariablesRules['no-use-before-define'], 189 | 190 | // Replace Airbnb 'no-useless-constructor' rule with '@typescript-eslint' version 191 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md 192 | 'no-useless-constructor': 'off', 193 | '@typescript-eslint/no-useless-constructor': baseES6Rules['no-useless-constructor'], 194 | 195 | // Replace Airbnb 'quotes' rule with '@typescript-eslint' version 196 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md 197 | quotes: 'off', 198 | '@typescript-eslint/quotes': baseStyleRules.quotes, 199 | 200 | // Replace Airbnb 'semi' rule with '@typescript-eslint' version 201 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md 202 | semi: 'off', 203 | '@typescript-eslint/semi': baseStyleRules.semi, 204 | 205 | // Replace Airbnb 'space-before-function-paren' rule with '@typescript-eslint' version 206 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md 207 | 'space-before-function-paren': 'off', 208 | '@typescript-eslint/space-before-function-paren': baseStyleRules['space-before-function-paren'], 209 | 210 | // Replace Airbnb 'require-await' rule with '@typescript-eslint' version 211 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md 212 | 'require-await': 'off', 213 | '@typescript-eslint/require-await': baseBestPracticesRules['require-await'], 214 | 215 | // Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version 216 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md 217 | 'no-return-await': 'off', 218 | '@typescript-eslint/return-await': [baseBestPracticesRules['no-return-await'], 'in-try-catch'], 219 | 220 | // Replace Airbnb 'space-infix-ops' rule with '@typescript-eslint' version 221 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-infix-ops.md 222 | 'space-infix-ops': 'off', 223 | '@typescript-eslint/space-infix-ops': baseStyleRules['space-infix-ops'], 224 | 225 | // Replace Airbnb 'object-curly-spacing' rule with '@typescript-eslint' version 226 | // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/object-curly-spacing.md 227 | 'object-curly-spacing': 'off', 228 | '@typescript-eslint/object-curly-spacing': baseStyleRules['object-curly-spacing'], 229 | 230 | // Append 'ts' and 'tsx' to Airbnb 'import/extensions' rule 231 | // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md 232 | 'import/extensions': [ 233 | baseImportsRules['import/extensions'][0], 234 | baseImportsRules['import/extensions'][1], 235 | { 236 | ...baseImportsRules['import/extensions'][2], 237 | ts: 'never', 238 | tsx: 'never', 239 | }, 240 | ], 241 | 242 | // Append 'ts' and 'tsx' extensions to Airbnb 'import/no-extraneous-dependencies' rule 243 | // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md 244 | 'import/no-extraneous-dependencies': [ 245 | baseImportsRules['import/no-extraneous-dependencies'][0], 246 | { 247 | ...baseImportsRules['import/no-extraneous-dependencies'][1], 248 | devDependencies: baseImportsRules[ 249 | 'import/no-extraneous-dependencies' 250 | ][1].devDependencies.reduce((result, devDep) => { 251 | const toAppend = [devDep]; 252 | const devDepWithTs = devDep.replace(/\bjs(x?)\b/g, 'ts$1'); 253 | if (devDepWithTs !== devDep) { 254 | toAppend.push(devDepWithTs); 255 | } 256 | return [...result, ...toAppend]; 257 | }, []), 258 | }, 259 | ], 260 | }, 261 | overrides: [ 262 | { 263 | files: ['*.ts', '*.tsx'], 264 | rules: { 265 | // The following rules are enabled in Airbnb config, but are already checked (more thoroughly) by the TypeScript compiler 266 | // Some of the rules also fail in TypeScript files, for example: https://github.com/typescript-eslint/typescript-eslint/issues/662#issuecomment-507081586 267 | // Rules are inspired by: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts 268 | 'constructor-super': 'off', 269 | 'getter-return': 'off', 270 | 'no-const-assign': 'off', 271 | 'no-dupe-args': 'off', 272 | 'no-dupe-class-members': 'off', 273 | 'no-dupe-keys': 'off', 274 | 'no-func-assign': 'off', 275 | 'no-import-assign': 'off', 276 | 'no-new-symbol': 'off', 277 | 'no-obj-calls': 'off', 278 | 'no-redeclare': 'off', 279 | 'no-setter-return': 'off', 280 | 'no-this-before-super': 'off', 281 | 'no-undef': 'off', 282 | 'no-unreachable': 'off', 283 | 'no-unsafe-negation': 'off', 284 | 'valid-typeof': 'off', 285 | // The following rules are enabled in Airbnb config, but are recommended to be disabled within TypeScript projects 286 | // See: https://github.com/typescript-eslint/typescript-eslint/blob/13583e65f5973da2a7ae8384493c5e00014db51b/docs/linting/TROUBLESHOOTING.md#eslint-plugin-import 287 | 'import/named': 'off', 288 | 'import/no-named-as-default-member': 'off', 289 | // Disable `import/no-unresolved`, see README.md for details 290 | 'import/no-unresolved': 'off', 291 | }, 292 | }, 293 | ], 294 | }; 295 | -------------------------------------------------------------------------------- /lint-staged.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '**/*.{json,md,yml}': ['prettier --write', 'git add'], 3 | '**/*.js': ['prettier --write', 'eslint --cache --fix', 'git add'], 4 | '.editorconfig': ['prettier --write', 'git add'], 5 | LICENSE: ['prettier --write', 'git add'], 6 | 'package.json': ['prettier --write', 'npm run format:package', 'git add'], 7 | }; 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-config-airbnb-typescript", 3 | "version": "0.0.0-development", 4 | "description": "Airbnb's ESLint config with TypeScript support", 5 | "license": "MIT", 6 | "author": "Matt Turnbull (https://iamturns.com)", 7 | "homepage": "https://github.com/iamturns/eslint-config-airbnb-typescript", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/iamturns/eslint-config-airbnb-typescript.git" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/iamturns/eslint-config-airbnb-typescript/issues" 14 | }, 15 | "scripts": { 16 | "pre-commit": "lint-staged", 17 | "format": "run-s format:package format:prettier format:eslint", 18 | "format:eslint": "eslint --fix ./ >/dev/null 2>&1 || true", 19 | "format:package": "prettier-package-json --write", 20 | "format:prettier": "prettier --write \"**/*.{js,json,md,yml}\" \".editorconfig\" \"LICENSE\"", 21 | "lint": "eslint ./", 22 | "prepare": "husky", 23 | "validate": "npm run lint" 24 | }, 25 | "dependencies": { 26 | "eslint-config-airbnb-base": "^15.0.0" 27 | }, 28 | "peerDependencies": { 29 | "@typescript-eslint/eslint-plugin": "^7.0.0", 30 | "@typescript-eslint/parser": "^7.0.0", 31 | "eslint": "^8.56.0" 32 | }, 33 | "devDependencies": { 34 | "@typescript-eslint/eslint-plugin": "7.1.0", 35 | "@typescript-eslint/parser": "7.1.0", 36 | "doctoc": "2.2.1", 37 | "eslint": "8.57.0", 38 | "eslint-config-prettier": "9.1.0", 39 | "eslint-plugin-import": "2.29.1", 40 | "husky": "9.0.11", 41 | "lint-staged": "15.2.2", 42 | "npm-run-all2": "6.1.2", 43 | "prettier": "3.2.5", 44 | "prettier-package-json": "2.8.0", 45 | "typescript": "5.3.3" 46 | }, 47 | "keywords": [ 48 | "airbnb", 49 | "config", 50 | "es2015", 51 | "es2016", 52 | "es2017", 53 | "es2018", 54 | "eslint", 55 | "eslintconfig", 56 | "javascript", 57 | "styleguide", 58 | "typescript" 59 | ] 60 | } 61 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | // Some settings automatically inherited from .editorconfig 2 | 3 | module.exports = { 4 | printWidth: 100, // https://github.com/airbnb/javascript#19.13 5 | tabWidth: 2, // https://github.com/airbnb/javascript#19.1 6 | useTabs: false, // https://github.com/airbnb/javascript#19.1 7 | semi: true, // https://github.com/airbnb/javascript#21.1 8 | singleQuote: true, // https://github.com/airbnb/javascript#6.1 9 | quoteProps: 'as-needed', // https://github.com/airbnb/javascript#3.6 10 | jsxSingleQuote: false, // https://github.com/airbnb/javascript/tree/master/react#quotes 11 | trailingComma: 'all', // https://github.com/airbnb/javascript#20.2 12 | bracketSpacing: true, // https://github.com/airbnb/javascript#19.12 13 | jsxBracketSameLine: false, // https://github.com/airbnb/javascript/tree/master/react#alignment 14 | arrowParens: 'always', // https://github.com/airbnb/javascript#8.4 15 | overrides: [ 16 | { 17 | files: '.editorconfig', 18 | options: { parser: 'yaml' }, 19 | }, 20 | { 21 | files: 'LICENSE', 22 | options: { parser: 'markdown' }, 23 | }, 24 | ], 25 | }; 26 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["config:js-lib"] 3 | } 4 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["**/*", "**/.*"], 3 | "compilerOptions": { 4 | /* Basic Options */ 5 | "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */, 6 | "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, 7 | // "lib": [], /* Specify library files to be included in the compilation. */ 8 | // "allowJs": true, /* Allow javascript files to be compiled. */ 9 | // "checkJs": true, /* Report errors in .js files. */ 10 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 11 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 12 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 13 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 14 | // "outFile": "./", /* Concatenate and emit output to single file. */ 15 | // "outDir": "./", /* Redirect output structure to the directory. */ 16 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 17 | // "composite": true, /* Enable project compilation */ 18 | // "removeComments": true, /* Do not emit comments to output. */ 19 | // "noEmit": true, /* Do not emit outputs. */ 20 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 21 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 22 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 23 | 24 | /* Strict Type-Checking Options */ 25 | "strict": true /* Enable all strict type-checking options. */, 26 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 27 | // "strictNullChecks": true, /* Enable strict null checks. */ 28 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 29 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 30 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 31 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 32 | 33 | /* Additional Checks */ 34 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 35 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 36 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 37 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 38 | 39 | /* Module Resolution Options */ 40 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 41 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 42 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 43 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 44 | // "typeRoots": [], /* List of folders to include type definitions from. */ 45 | // "types": [], /* Type declaration files to be included in compilation. */ 46 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 47 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 48 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 49 | 50 | /* Source Map Options */ 51 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 52 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 53 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 54 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 55 | 56 | /* Experimental Options */ 57 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 58 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 59 | } 60 | } 61 | --------------------------------------------------------------------------------