-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from doximity/setup
🎉 Setup project
- Loading branch information
Showing
17 changed files
with
5,608 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
root: true, | ||
parser: "esprima", | ||
env: { | ||
node: true | ||
}, | ||
extends: ["eslint:recommended", "plugin:prettier/recommended"] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
In order to clarify the intellectual property license granted with Contributions from any person or entity, Doximity Inc. ("Doximity") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Doximity; it does not change your rights to use your own Contributions for any other purpose. | ||
|
||
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Doximity. Except for the license granted herein to Doximity and recipients of software distributed by Doximity, You reserve all right, title, and interest in and to Your Contributions. | ||
|
||
### Definitions | ||
|
||
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Doximity. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. | ||
|
||
1. "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Doximity for inclusion in, or documentation of, any of the products owned or managed by Doximity (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Doximity or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Doximity for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." | ||
|
||
2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to Doximity and to recipients of software distributed by Doximity a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. | ||
|
||
3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to Doximity and to recipients of software distributed by Doximity a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed. | ||
|
||
4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to Doximity, or that your employer has executed a separate Corporate CLA with Doximity. | ||
|
||
5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions. | ||
|
||
6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. | ||
|
||
7. Should You wish to submit work that is not Your original creation, You may submit it to Doximity separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [[]named here]". | ||
|
||
8. You agree to notify Doximity of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright [2020] [Doximity, Inc] | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,101 @@ | ||
# eslint-generate-todo | ||
Tool for generating eslint todo files | ||
|
||
# Installation | ||
|
||
```bash | ||
yarn add --dev eslint-generate-todo | ||
``` | ||
|
||
# Usage | ||
|
||
Generate a `.eslintrc-todo` file using the `eslint-generate-todo` CLI: | ||
|
||
```bash | ||
eslint-generate-todo | ||
``` | ||
|
||
You may then extend the resulting `.eslintrc-todo` file in your eslint config: | ||
|
||
```yaml | ||
extends: | ||
- .eslintrc-todo.yml | ||
``` | ||
## CLI | ||
Run `eslint-generate-todo` through the CLI with this script. Run it with `--help` to see the options. Files use glob syntax and may be specified multiple times. | ||
|
||
```bash | ||
eslint-generate-todo [files...] | ||
``` | ||
|
||
### `--format` | ||
|
||
If you want to specify the file format of the output `.eslintrc-todo` file, you can run `eslint-generate-todo` with the `--format` flag (or `-f`), followed by either `yaml` or `json`. By default `eslint-generate-todo` outputs to `yaml`. | ||
|
||
```bash | ||
eslint-generate-todo --format json | ||
``` | ||
|
||
### `--off` | ||
|
||
To set rule overrides in the generated `.eslintrc-todo` file to `"off"` instead of `"warn"`, you can run `eslint-generate-todo` with the `--off` (or `-o`) flag. | ||
|
||
```bash | ||
eslint-generate-todo --off | ||
``` | ||
|
||
### `--path` | ||
|
||
To change the output path of the generated `.eslintrc-todo` file, you can run `eslint-generate-todo` with the `--path` (or `p`) flag, followed by the project root-relative path. | ||
|
||
```bash | ||
eslint-generate-todo --path config/eslint-overrides.yml | ||
``` | ||
|
||
# Contributing | ||
|
||
Before contributing code to `eslint-generate-todo`, please read and sign the [Contributor License Agreement](CONTRIBUTOR_LICENSE_AGREEMENT.md). | ||
|
||
Clone the repository and install dependencies: | ||
|
||
```bash | ||
git clone [email protected]:doximity/eslint-generate-todo.git | ||
cd eslint-generate-todo | ||
yarn install | ||
``` | ||
|
||
To build `eslint-generate-todo`, you can run the `build` script: | ||
|
||
```bash | ||
yarn run build | ||
``` | ||
|
||
While developing, you can run the `dev` script to automatically rebuild as files change: | ||
|
||
```bash | ||
yarn run dev | ||
``` | ||
|
||
To lint code changes, you can run the `lint` script: | ||
|
||
```bash | ||
yarn run lint | ||
``` | ||
|
||
To format code using Prettier, you can run the `format` script: | ||
|
||
```bash | ||
yarn run format | ||
``` | ||
|
||
To run tests with Jest, you can run the `test` script: | ||
|
||
```bash | ||
yarn run test | ||
``` | ||
|
||
# License | ||
|
||
The `eslint-generate-todo` tool is offered under the [Apache v2](LICENSE) license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env node | ||
|
||
const program = require("caporal"); | ||
const { execute } = require("../dist/index"); | ||
const package = require("../package.json"); | ||
|
||
program | ||
.version(package.version) | ||
.description("Generates a list of disabled eslint rules.") | ||
.argument("[files...]", "Files to validate", program.LIST, ".") | ||
.option( | ||
"-f --format <format>", | ||
"Set the output format of the todo list <yaml | json>", | ||
["yaml", "json"], | ||
"yaml" | ||
) | ||
.option( | ||
"-o --off", | ||
"Set todo list items to 'off' instead of 'warning'", | ||
program.BOOL, | ||
false | ||
) | ||
.option( | ||
"-p --path <path>", | ||
"Set the location of the generated todo list overrides file" | ||
) | ||
.action(async (args, options, logger) => { | ||
const level = options.off ? "off" : "warn"; | ||
|
||
const configFile = await execute(args.files, { | ||
level, | ||
format: options.format, | ||
path: options.path | ||
}); | ||
|
||
logger.info(`ESLint todo config written to ${configFile}`); | ||
logger.info("You may now extend this config in your ESLint config file."); | ||
}); | ||
|
||
program.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
roots: ["<rootDir>/src"], | ||
testMatch: ["**/__tests__/**/*.+(ts|js)", "**/?(*.)+(spec|test).+(ts|js)"], | ||
transform: { | ||
"^.+\\.ts$": "ts-jest" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"name": "eslint-generate-todo", | ||
"version": "0.0.0", | ||
"description": "Tool for generating eslint todo files", | ||
"main": "dist/index.js", | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
"scripts": { | ||
"build": "yarn prettier --list-different & yarn lint && tsc", | ||
"dev": "nodemon --watch . --ignore dist --ext js,ts,json --exec \"yarn build\"", | ||
"format": "yarn prettier --write", | ||
"lint": "eslint . --ext .js,.ts", | ||
"prettier": "prettier \"{src,bin}/**\"", | ||
"test": "jest" | ||
}, | ||
"bin": { | ||
"eslint-generate-todo": "./bin/eslint-generate-todo.js" | ||
}, | ||
"files": [ | ||
"dist", | ||
"bin" | ||
], | ||
"author": "Mark Brouch <[email protected]>", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/doximity/eslint-generate-todo/issues" | ||
}, | ||
"homepage": "https://github.com/doximity/eslint-generate-todo#readme", | ||
"repository": "github:doximity/eslint-generate-todo", | ||
"keywords": [ | ||
"ESLint", | ||
"linting", | ||
"eslint-todo" | ||
], | ||
"dependencies": { | ||
"caporal": "^1.3.0", | ||
"eslint": "^6.7.2", | ||
"js-yaml": "^3.13.1" | ||
}, | ||
"devDependencies": { | ||
"@types/eslint": "^6.1.3", | ||
"@types/jest": "^24.0.24", | ||
"@types/js-yaml": "^3.12.1", | ||
"@types/node": "^12.12.21", | ||
"@typescript-eslint/eslint-plugin": "^2.12.0", | ||
"@typescript-eslint/parser": "^2.12.0", | ||
"eslint-config-prettier": "^6.7.0", | ||
"eslint-plugin-jest": "^23.1.1", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"husky": "^3.1.0", | ||
"jest": "^24.9.0", | ||
"nodemon": "^2.0.2", | ||
"precise-commits": "^1.0.2", | ||
"prettier": "^1.19.1", | ||
"ts-jest": "^24.2.0", | ||
"typescript": "^3.7.3" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "precise-commits" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint"], | ||
extends: [ | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
overrides: [ | ||
{ | ||
files: ["__tests__", "**/*.spec.{js,ts}"], | ||
plugins: ["jest"], | ||
extends: ["plugin:jest/recommended", "plugin:jest/style"] | ||
} | ||
] | ||
}; |
Oops, something went wrong.