Skip to content

Commit 0c260da

Browse files
authored
breaking: rename to @callstack/eslint-config (#32)
1 parent 59310f8 commit 0c260da

File tree

8 files changed

+1435
-34
lines changed

8 files changed

+1435
-34
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ cache:
33
yarn: true
44
directories:
55
- node_modules
6+
- test/node_modules
67
notifications:
78
email: false
89
node_js:
10+
- '10'
911
- '8'
10-
- '6'

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# eslint-config-callstack-io
1+
# eslint-config-callstack
22

33
Callstack eslint config utilizing Airbnb config, Flow, Prettier and Jest support.
44

@@ -19,19 +19,10 @@ Additionally, it sets these environments:
1919
}
2020
```
2121

22-
And for test files matching default Jest `testMatch`:
23-
```json
24-
{
25-
"env": {
26-
"jest/globals": true
27-
}
28-
}
29-
```
30-
3122
## Installation
3223

3324
```
34-
yarn add --dev eslint eslint-config-callstack-io
25+
yarn add --dev eslint @callstack/eslint-config
3526
```
3627

3728
*Note: We're using `yarn` to install deps. Feel free to change commands to use `npm` 3+ and `npx` if you like*
@@ -42,18 +33,17 @@ Add to your eslint config (`.eslintrc`, or `eslintConfig` field in `package.json
4233

4334
```json
4435
{
45-
"extends": "callstack-io"
36+
"extends": "@callstack"
4637
}
4738
```
4839

4940
### Example of extending the configuration
5041

5142
```json
5243
{
53-
"extends": "callstack-io",
44+
"extends": "@callstack",
5445
"rules": {
5546
"global-require": 0,
56-
"react/destructuring-assignment": 0,
5747
"prefer-destructuring": 0
5848
}
5949
}

index.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ module.exports = {
77
'plugin:jest/recommended',
88
'prettier',
99
'prettier/flowtype',
10-
'prettier/react'
10+
'prettier/react',
1111
],
1212
env: {
1313
browser: true,
1414
es6: true,
15-
node: true
15+
node: true,
1616
},
1717
parser: 'babel-eslint',
1818
plugins: ['flowtype', 'jest', 'prettier'],
@@ -23,7 +23,7 @@ module.exports = {
2323
'flowtype/require-return-type': [
2424
0,
2525
'always',
26-
{ annotateUndefined: 'never' }
26+
{ annotateUndefined: 'never' },
2727
],
2828
'flowtype/require-valid-file-annotation': 2,
2929
'import/extensions': 0,
@@ -43,25 +43,26 @@ module.exports = {
4343
'error',
4444
{
4545
singleQuote: true,
46-
trailingComma: 'es5'
47-
}
46+
trailingComma: 'es5',
47+
},
4848
],
4949
'react/forbid-prop-types': 1,
5050
'react/jsx-filename-extension': [0, { extensions: ['.js'] }],
5151
'import/no-extraneous-dependencies': [
5252
'error',
53-
{ devDependencies: ['**/*.test.js', '**/__tests__/**'] }
53+
{ devDependencies: ['**/*.test.js', '**/__tests__/**'] },
5454
],
5555
'react/prefer-stateless-function': 0,
5656
'react/prop-types': 0,
5757
'react/require-default-props': 0,
58-
'react/sort-comp': 0
58+
'react/sort-comp': 0,
59+
'react/destructuring-assignment': 0,
5960
},
6061
settings: {
6162
'import/resolver': {
6263
node: {
63-
extensions: ['.js', '.android.js', '.ios.js', '.native.js']
64-
}
65-
}
66-
}
64+
extensions: ['.js', '.android.js', '.ios.js', '.native.js'],
65+
},
66+
},
67+
},
6768
};

package.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
{
2-
"name": "eslint-config-callstack-io",
2+
"name": "@callstack/eslint-config",
33
"version": "1.1.2",
44
"description": "ESLint preset extending Airbnb, Flow, Prettier and Jest",
55
"main": "index.js",
6-
"repository": "[email protected]:callstack/eslint-config-callstack-io.git",
6+
"repository": "[email protected]:callstack/eslint-config-callstack.git",
77
"author": "Michał Pierzchała <[email protected]>",
88
"license": "MIT",
9-
"keywords": [
10-
"eslint",
11-
"eslint config",
12-
"callstack"
13-
],
9+
"keywords": ["eslint", "eslint config", "callstack"],
1410
"dependencies": {
1511
"babel-eslint": "^8.2.6",
1612
"eslint-config-airbnb": "^17.1.0",
@@ -30,6 +26,6 @@
3026
"eslint": "^5.4.0"
3127
},
3228
"scripts": {
33-
"test": "echo no tests"
29+
"test": "cd test && yarn && yarn eslint *.js"
3430
}
3531
}

test/.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@callstack"
3+
}

test/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @flow
2+
import React from 'react';
3+
4+
type Props = {
5+
isTruthy: string,
6+
};
7+
8+
export default class Bool extends React.Component<Props> {
9+
render() {
10+
return !!this.props.isTruthy;
11+
}
12+
}

test/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "plugin-test",
3+
"version": "0.0.0",
4+
"description": "test",
5+
"main": "index.js",
6+
"license": "MIT",
7+
"dependencies": {
8+
"@callstack/eslint-config": "..",
9+
"eslint": "^5.4.0",
10+
"react": "^16.4.2"
11+
}
12+
}

0 commit comments

Comments
 (0)