Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add separate eslint packages for Typescript and Flowtype #723

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"eslint.autoFixOnSave": true,
"eslint.nodePath": "common/temp/node_modules",
"eslint.options": {
"ignorePattern": [
Expand All @@ -17,4 +16,7 @@
},
"flow.pathToFlow": "${workspaceFolder}/common/temp/node_modules/.bin/flow",
"javascript.validate.enable": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
}
7 changes: 7 additions & 0 deletions eslint-config-fusion-flowtype/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
root: true,
extends: require.resolve('./index.js'),
env: {
node: true
}
};
16 changes: 16 additions & 0 deletions eslint-config-fusion-flowtype/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[ignore]
.*/node_modules/@uber/node-rosetta/.*
.*/templates/.*

[include]
../node_modules
../../node_modules

[libs]
../flow-typed/

[lints]

[options]

[strict]
42 changes: 42 additions & 0 deletions eslint-config-fusion-flowtype/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--
chrisdothtml marked this conversation as resolved.
Show resolved Hide resolved
Thank you for taking the time to submit an issue.

Before opening a new issue, please search existing issues (https://github.com/fusionjs/eslint-config-fusion/issues)
to double-check your issue isn't already known.

To make it easier for us to help you — please follow the suggested format below.
-->

<!--- Provide a general summary of the issue in the title -->

### Type of issue

<!-- Feature request or bug -->

### Description

<!--- Describe the issue or the enhancement you want to see. -->

### Current behavior

<!--- What happens. -->

### Expected behavior

<!--- What should happen. -->

### Steps to reproduce

1.
2.
3.

### Your environment

* eslint-config-fusion-flowtype version:

* Node.js version (`node --version`):

* npm version (`npm --version`):

* Operating System:
1 change: 1 addition & 0 deletions eslint-config-fusion-flowtype/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
1 change: 1 addition & 0 deletions eslint-config-fusion-flowtype/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.yarnpkg.com
21 changes: 21 additions & 0 deletions eslint-config-fusion-flowtype/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Uber Technologies, Inc.

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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

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.
17 changes: 17 additions & 0 deletions eslint-config-fusion-flowtype/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# eslint-config-fusion

[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)

`eslint-config-fusion-flowtype` is an [eslint](https://www.github.com/eslint/eslint) config recommended for use with Fusion.js.

## Usage

Extend `eslint-config-fusion-flowtype` in your `.eslintrc.js`:

```js
module.exports = {
extends: [
require.resolve('eslint-config-fusion-flowtype')
]
};
```
22 changes: 22 additions & 0 deletions eslint-config-fusion-flowtype/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// @flow
module.exports = {
extends: [
'plugin:flowtype/recommended',
],

plugins: [
'eslint-plugin-flowtype',
],
rules: {
// Enforce flow file declarations
'flowtype/require-valid-file-annotation': ['error', 'always'],

// Enforces consistent spacing within generic type annotation parameters.
// https://github.com/gajus/eslint-plugin-flowtype/blob/master/.README/rules/generic-spacing.md
'flowtype/generic-spacing': 'off',

// Fix inconsistency between Flow (inherited rule from flowtype/recommended) and Prettier
// https://jeng.uberinternal.com/browse/WPT-3404
'flowtype/space-after-type-colon': 'off',
},
};
38 changes: 38 additions & 0 deletions eslint-config-fusion-flowtype/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "eslint-config-fusion-flowtype",
"version": "0.0.0-monorepo",
"description": "eslint-config-fusion-flowtype is an eslint config recommended for use with FusionJS.",
"license": "MIT",
"repository": {
"directory": "eslint-config-fusion-flowtype",
"type": "git",
"url": "https://github.com/fusionjs/fusionjs"
},
"files": [
"rules",
"index.js"
],
"main": "index.js",
"peerDependencies": {
"eslint-plugin-flowtype": "^3.11.1"
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"eslint": "^6.0.1",
"eslint-plugin-flowtype": "^3.11.1",
"flow-bin": "^0.109.0",
"prettier": "^1.18.2"
},
"scripts": {
"lint": "eslint .",
"test": "echo ok",
"build": "echo ok",
"flow": "flow check"
},
"engines": {
"node": ">=8.9.4",
"npm": ">=5.0.0",
"yarn": ">=1.0.0"
},
"homepage": "https://fusionjs.com/api/eslint-config-fusion"
}
Loading