Skip to content

Commit 1488e1f

Browse files
authored
use eslint-, stylelint- & prettier-config from natterstefan/eslint-config-ns (#10)
1 parent 23e1a6a commit 1488e1f

6 files changed

Lines changed: 196 additions & 267 deletions

File tree

.eslintrc.js

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,3 @@
11
module.exports = {
2-
parser: 'babel-eslint',
3-
extends: ['airbnb', 'prettier', 'prettier/react'],
4-
plugins: ['jest', 'prettier'], // alternative: https://github.com/prettier/prettier-eslint
5-
env: {
6-
browser: true,
7-
es6: true,
8-
node: false,
9-
jest: true,
10-
},
11-
parserOptions: {
12-
ecmaVersion: 6,
13-
sourceType: 'module',
14-
ecmaFeatures: {
15-
defaultParams: true,
16-
spread: true,
17-
},
18-
},
19-
globals: {
20-
jest: true,
21-
afterAll: true,
22-
afterEach: true,
23-
beforeAll: true,
24-
beforeEach: true,
25-
context: true,
26-
describe: true,
27-
expect: true,
28-
global: true,
29-
it: true,
30-
module: true,
31-
window: true,
32-
},
33-
rules: {
34-
'import/prefer-default-export': 0,
35-
'no-case-declarations': 0,
36-
'no-plusplus': 0,
37-
'prettier/prettier': [
38-
'error',
39-
{
40-
// keep this in sync with .prettierrc
41-
bracketSpacing: true,
42-
printWidth: 100,
43-
semi: false,
44-
singleQuote: true,
45-
trailingComma: 'all',
46-
},
47-
],
48-
'react/jsx-curly-brace-presence': 'never', // use '' when passing a strint as a property
49-
'react/jsx-filename-extension': 0, // we do not use *.jsx files
50-
'react/sort-comp': 2,
51-
},
52-
overrides: [
53-
{
54-
files: ['src/**/*.test.js'],
55-
rules: {
56-
'no-console': 0,
57-
'global-require': 0,
58-
},
59-
},
60-
],
2+
extends: '@natterstefan/eslint-config-ns',
613
}

.prettierrc

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

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
99
### Changed
1010

1111
* upgraded all packages to latest version, including major releases
12+
* use [@natterstefan/eslint-config-ns](https://github.com/natterstefan/eslint-config-ns)
13+
for eslint, stylelint and prettier
1214

1315
## 2018/05/25 0.0.2
1416

package.json

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@
9090
"styled-components": "3.3.0"
9191
},
9292
"devDependencies": {
93+
"@natterstefan/eslint-config-ns": "git+https://github.com/natterstefan/eslint-config-ns.git#master",
9394
"babel-core": "6.26.3",
94-
"babel-eslint": "8.2.3",
95-
"babel-jest": "23.0.0",
95+
"babel-jest": "23.0.1",
9696
"babel-loader": "7.1.4",
9797
"babel-plugin-transform-react-remove-prop-types": "0.4.13",
9898
"babel-preset-env": "1.7.0",
@@ -106,27 +106,16 @@
106106
"enzyme-adapter-react-16": "1.1.1",
107107
"enzyme-to-json": "3.3.4",
108108
"error-overlay-webpack-plugin": "0.1.5",
109-
"eslint": "4.19.1",
110-
"eslint-config-airbnb": "16.1.0",
111-
"eslint-config-prettier": "2.9.0",
112-
"eslint-plugin-import": "2.12.0",
113-
"eslint-plugin-jest": "21.15.2",
114-
"eslint-plugin-jsx-a11y": "6.0.3",
115-
"eslint-plugin-prettier": "2.6.0",
116-
"eslint-plugin-react": "7.8.2",
117109
"extract-text-webpack-plugin": "4.0.0-beta.0",
118110
"html-webpack-plugin": "3.2.0",
119111
"husky": "0.14.3",
120-
"jest": "23.0.0",
112+
"jest": "23.0.1",
121113
"jest-styled-components": "5.0.1",
122114
"lint-staged": "7.1.2",
123115
"node-sass": "4.9.0",
124-
"prettier": "1.12.1",
125116
"redux-mock-store": "1.5.1",
126117
"sass-loader": "7.0.1",
127118
"size-limit": "0.18.1",
128-
"stylelint": "9.2.0",
129-
"stylelint-config-sass-guidelines": "5.0.0",
130119
"uglifyjs-webpack-plugin": "1.2.5",
131120
"webpack": "4.9.1",
132121
"webpack-cli": "2.1.4",

stylelint.config.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
1-
/* global module */
21
module.exports = {
3-
extends: 'stylelint-config-sass-guidelines',
2+
extends: '@natterstefan/eslint-config-ns/stylelint',
43
ignoreFiles: [
54
'./coverage/**/*',
65
'./dist/**/*',
76
'./node_modules/**/*',
87
'./src/**/__snapshots__/**/*',
98
],
10-
rules: {
11-
'max-nesting-depth': 2,
12-
// stylelint-config-sass-guidelines requires
13-
// you to omit the '.scss' ending in @import statements. But in combination
14-
// with webpack we still need it.
15-
'scss/at-import-partial-extension-blacklist': null,
16-
// Enforce BEM class patterns, inspired by
17-
// - https://github.com/simonsmith/stylelint-selector-bem-pattern/issues/23#issuecomment-279216443
18-
// - https://github.com/bjankord/stylelint-config-sass-guidelines/issues/20#issuecomment-349972873
19-
// probably it can be achieved with them too:
20-
// - https://github.com/simonsmith/stylelint-selector-bem-pattern
21-
// - https://github.com/postcss/postcss-bem-linter
22-
'selector-class-pattern':
23-
'^(?:(?:o|c|u|t|s|is|has|_|js|qa)-)?[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$',
24-
},
259
}

0 commit comments

Comments
 (0)