Skip to content
This repository was archived by the owner on May 16, 2020. It is now read-only.

Commit 1638e23

Browse files
fix: fix up ui-components linting and update some misaligned rules
1 parent 8adfb11 commit 1638e23

File tree

16 files changed

+55
-43
lines changed

16 files changed

+55
-43
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
rules: {
3-
'import/core-modules': ['electron'],
3+
'import/core-modules': ['error', 'electron'],
44
}
55
};

packages/eslint-config-atlauncher/configs/react.js

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const base = require('./index');
2+
3+
const rules = base.extends.concat([
4+
// configs
5+
'./configs/electron'
6+
].map(require.resolve));
7+
8+
module.exports = {
9+
plugins: base.plugins,
10+
extends: rules,
11+
env: base.env,
12+
parser: base.parser,
13+
parserOptions: base.parserOptions
14+
};

packages/eslint-config-atlauncher/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
const configs = [
2-
'./configs/electron',
3-
'./configs/react'
4-
].map(require.resolve);
5-
61
const rules = [
72
// eslint rules
83
'./rules/possible-errors',
@@ -13,7 +8,6 @@ const rules = [
138
'./rules/ecmascript-6',
149

1510
// eslint plugins
16-
'./rules/plugin-filenames',
1711
'./rules/plugin-import',
1812
'./rules/plugin-jsx-a11y',
1913
'./rules/plugin-promise',
@@ -30,7 +24,6 @@ module.exports = {
3024
'filenames'
3125
],
3226
extends: rules,
33-
configs,
3427
env: {
3528
node: true,
3629
es6: true,

packages/eslint-config-atlauncher/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"devDependencies": {
2727
"babel-eslint": "^7.2.1",
2828
"eslint": "^3.19.0",
29-
"eslint-plugin-filenames": "^1.1.0",
3029
"eslint-plugin-import": "^2.2.0",
3130
"eslint-plugin-jsx-a11y": "^4.0.0",
3231
"eslint-plugin-no-empty-blocks": "0.0.2",
@@ -36,8 +35,10 @@
3635
"peerDependencies": {
3736
"babel-eslint": "^7.2.1",
3837
"eslint": "^3.19.0",
39-
"eslint-plugin-jsx-a11y": "^4.0.0",
4038
"eslint-plugin-import": "^2.2.0",
39+
"eslint-plugin-jsx-a11y": "^4.0.0",
40+
"eslint-plugin-no-empty-blocks": "0.0.2",
41+
"eslint-plugin-promise": "^3.5.0",
4142
"eslint-plugin-react": "^6.10.3"
4243
},
4344
"engines": {

packages/eslint-config-atlauncher/rules/plugin-filenames.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/eslint-config-atlauncher/rules/plugin-import.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,12 @@ module.exports = {
4646

4747
// don't use the `.js` extension in the import path for local files
4848
'import/extensions': ['error', 'always', {
49-
'js': 'never'
50-
}],
51-
52-
// make sure imports are ordered
53-
'import/order': ['error', {
54-
'newlines-between': 'always',
55-
'groups': [
56-
['external', 'builtin'],
57-
['index', 'sibling', 'parent', 'internal']
58-
]
49+
js: 'never'
5950
}],
6051

6152
// make sure there is one new line after imports
6253
'import/newline-after-import': ['error', {
63-
'count': 1
54+
count: 1
6455
}]
6556
}
6657
};

packages/eslint-config-atlauncher/rules/plugin-react.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ module.exports = {
6868
// requires all components to be written as ES6 classes and not via `React.createClass`
6969
'react/prefer-es6-class': 'error',
7070

71-
// ensures stateless components aren't doing more than they should
72-
'react/prefer-stateless-function': 'error',
71+
// ensures stateless components are used where possible over `React.Component` but allow `React.PureComponent`
72+
'react/prefer-stateless-function': ['warn', {ignorePureComponents: true}],
7373

7474
// ensures PropType's are written and contain all properties are added into it
7575
'react/prop-types': 'error',

packages/eslint-config-atlauncher/rules/stylistic-issues.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@ module.exports = {
1616
properties: 'always'
1717
}],
1818

19-
// all comments should start with a lowercase letter
20-
'capitalized-comments': ['error', 'never'],
19+
// all comments should start with a lowercase letter unless in a block comment
20+
'capitalized-comments': ['error', 'never', {
21+
line: {
22+
ignoreInlineComments: true
23+
},
24+
block: {
25+
ignoreInlineComments: true,
26+
ignorePattern: '.'
27+
}
28+
}],
2129

2230
// don't allow dangling commas
2331
'comma-dangle': ['error', 'never'],
@@ -179,7 +187,7 @@ module.exports = {
179187
allowTemplateLiterals: true
180188
}],
181189

182-
// warn when not using jsdoc
190+
// warn when not using jsdoc unless function name matches one in the ignore list
183191
'require-jsdoc': ['warn', {
184192
require: {
185193
FunctionDeclaration: true,

packages/ui-components/.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"extends": ["@atlauncher/eslint-config-atlauncher"]
3-
}
3+
}

0 commit comments

Comments
 (0)