Skip to content

Commit 79a781d

Browse files
Merge pull request #51 from instantcommerce/fix/use-tabs
We've settled on using tabs as the default going forward ✅ BREAKING CHANGE: update prettier config to `useTabs: true`
2 parents 6caf7a0 + 940da7b commit 79a781d

File tree

3 files changed

+503
-503
lines changed

3 files changed

+503
-503
lines changed

backend.js

Lines changed: 121 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,125 @@
11
module.exports = {
2-
parser: '@typescript-eslint/parser',
3-
extends: [
4-
'eslint:recommended',
5-
'plugin:@typescript-eslint/eslint-recommended',
6-
'plugin:@typescript-eslint/recommended',
7-
'plugin:prettier/recommended',
8-
'plugin:import/errors',
9-
'plugin:import/warnings',
10-
'plugin:import/typescript',
11-
],
12-
plugins: ['prettier'],
13-
parserOptions: {
14-
ecmaVersion: 2017,
15-
sourceType: 'module',
16-
project: './tsconfig.json',
17-
},
18-
env: {
19-
node: true,
20-
es6: true,
21-
jest: true,
22-
},
23-
settings: {
24-
'import/resolver': {
25-
alias: {
26-
map: [
27-
['@module', './src/modules'],
28-
['@common', './src/common'],
29-
['@util', './src/util'],
30-
],
31-
extensions: ['.js', '.ts'],
32-
},
33-
node: {
34-
extensions: ['.js', '.ts'],
35-
},
36-
},
37-
'import/parsers': {
38-
'@typescript-eslint/parser': ['.ts'],
39-
},
40-
},
41-
rules: {
42-
'@typescript-eslint/explicit-function-return-type': ['off'],
43-
'@typescript-eslint/explicit-member-accessibility': [1],
44-
'@typescript-eslint/interface-name-prefix': [0, 'never'],
45-
'@typescript-eslint/no-explicit-any': 0,
46-
'@typescript-eslint/no-namespace': 0,
47-
'@typescript-eslint/no-inferrable-types': 0,
48-
'import/extensions': [
49-
1,
50-
'never',
51-
{
52-
svg: 'always',
53-
},
54-
],
55-
'import/no-extraneous-dependencies': [
56-
'error',
57-
{
58-
devDependencies: true,
59-
optionalDependencies: false,
60-
peerDependencies: false,
61-
},
62-
],
63-
'no-param-reassign': 0,
64-
'no-underscore-dangle': 0,
65-
'no-use-before-define': 0,
66-
'no-console': ['error', { allow: ['error'] }],
67-
'padding-line-between-statements': 'off',
68-
'@typescript-eslint/padding-line-between-statements': [
69-
'error',
70-
// blank line before return
71-
{ blankLine: 'always', prev: '*', next: 'return' },
72-
// blank line before and after block like statements
73-
{ blankLine: 'always', prev: '*', next: 'block-like' },
74-
{ blankLine: 'always', prev: 'block-like', next: '*' },
75-
// blank line before and after function declarations
76-
{ blankLine: 'always', prev: '*', next: 'function' },
77-
{ blankLine: 'always', prev: 'function', next: '*' }
78-
],
79-
'spaced-comment': 'error',
80-
// default case in a switch needs to be last
81-
'default-case-last': 'error',
2+
parser: '@typescript-eslint/parser',
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/eslint-recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:prettier/recommended',
8+
'plugin:import/errors',
9+
'plugin:import/warnings',
10+
'plugin:import/typescript',
11+
],
12+
plugins: ['prettier'],
13+
parserOptions: {
14+
ecmaVersion: 2017,
15+
sourceType: 'module',
16+
project: './tsconfig.json',
17+
},
18+
env: {
19+
node: true,
20+
es6: true,
21+
jest: true,
22+
},
23+
settings: {
24+
'import/resolver': {
25+
alias: {
26+
map: [
27+
['@module', './src/modules'],
28+
['@common', './src/common'],
29+
['@util', './src/util'],
30+
],
31+
extensions: ['.js', '.ts'],
32+
},
33+
node: {
34+
extensions: ['.js', '.ts'],
35+
},
36+
},
37+
'import/parsers': {
38+
'@typescript-eslint/parser': ['.ts'],
39+
},
40+
},
41+
rules: {
42+
'@typescript-eslint/explicit-function-return-type': ['off'],
43+
'@typescript-eslint/explicit-member-accessibility': [1],
44+
'@typescript-eslint/interface-name-prefix': [0, 'never'],
45+
'@typescript-eslint/no-explicit-any': 0,
46+
'@typescript-eslint/no-namespace': 0,
47+
'@typescript-eslint/no-inferrable-types': 0,
48+
'import/extensions': [
49+
1,
50+
'never',
51+
{
52+
svg: 'always',
53+
},
54+
],
55+
'import/no-extraneous-dependencies': [
56+
'error',
57+
{
58+
devDependencies: true,
59+
optionalDependencies: false,
60+
peerDependencies: false,
61+
},
62+
],
63+
'no-param-reassign': 0,
64+
'no-underscore-dangle': 0,
65+
'no-use-before-define': 0,
66+
'no-console': ['error', { allow: ['error'] }],
67+
'padding-line-between-statements': 'off',
68+
'@typescript-eslint/padding-line-between-statements': [
69+
'error',
70+
// blank line before return
71+
{ blankLine: 'always', prev: '*', next: 'return' },
72+
// blank line before and after block like statements
73+
{ blankLine: 'always', prev: '*', next: 'block-like' },
74+
{ blankLine: 'always', prev: 'block-like', next: '*' },
75+
// blank line before and after function declarations
76+
{ blankLine: 'always', prev: '*', next: 'function' },
77+
{ blankLine: 'always', prev: 'function', next: '*' },
78+
],
79+
'spaced-comment': 'error',
80+
// default case in a switch needs to be last
81+
'default-case-last': 'error',
8282

83-
'import/order': [
84-
'error',
85-
{
86-
alphabetize: {
87-
order: 'asc',
88-
caseInsensitive: true,
89-
},
90-
groups: ['builtin', 'external', ['internal', 'parent'], ['sibling', 'index']],
91-
pathGroups: [
92-
{
93-
pattern: 'react',
94-
group: 'external',
95-
position: 'before',
96-
},
97-
{
98-
pattern: '@**',
99-
group: 'internal',
100-
position: 'before',
101-
},
102-
{
103-
pattern: '@**/**',
104-
group: 'internal',
105-
position: 'before',
106-
},
107-
],
108-
pathGroupsExcludedImportTypes: [],
109-
},
110-
],
83+
'import/order': [
84+
'error',
85+
{
86+
alphabetize: {
87+
order: 'asc',
88+
caseInsensitive: true,
89+
},
90+
groups: ['builtin', 'external', ['internal', 'parent'], ['sibling', 'index']],
91+
pathGroups: [
92+
{
93+
pattern: 'react',
94+
group: 'external',
95+
position: 'before',
96+
},
97+
{
98+
pattern: '@**',
99+
group: 'internal',
100+
position: 'before',
101+
},
102+
{
103+
pattern: '@**/**',
104+
group: 'internal',
105+
position: 'before',
106+
},
107+
],
108+
pathGroupsExcludedImportTypes: [],
109+
},
110+
],
111111

112-
'prettier/prettier': [
113-
'error',
114-
{
115-
printWidth: 120,
116-
semi: true,
117-
singleQuote: true,
118-
tabWidth: 2,
119-
trailingComma: 'none',
120-
useTabs: false,
121-
arrowParens: 'avoid',
122-
},
123-
],
124-
},
112+
'prettier/prettier': [
113+
'error',
114+
{
115+
printWidth: 120,
116+
semi: true,
117+
singleQuote: true,
118+
tabWidth: 2,
119+
trailingComma: 'none',
120+
useTabs: true,
121+
arrowParens: 'avoid',
122+
},
123+
],
124+
},
125125
};

index.js

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
module.exports = {
2-
extends: ['prettier'],
3-
plugins: ['@typescript-eslint', 'import', 'prettier'],
4-
settings: {
5-
'import/resolver': {
6-
node: {
7-
extensions: ['.js', '.ts'],
8-
},
9-
},
10-
'import/parsers': {
11-
'@typescript-eslint/parser': ['.ts'],
12-
},
13-
},
14-
rules: {
15-
// come up with some nice rules here
2+
extends: ['prettier'],
3+
plugins: ['@typescript-eslint', 'import', 'prettier'],
4+
settings: {
5+
'import/resolver': {
6+
node: {
7+
extensions: ['.js', '.ts'],
8+
},
9+
},
10+
'import/parsers': {
11+
'@typescript-eslint/parser': ['.ts'],
12+
},
13+
},
14+
rules: {
15+
// come up with some nice rules here
1616

17-
'import/order': [
18-
'error',
19-
{
20-
alphabetize: {
21-
order: 'asc',
22-
caseInsensitive: true,
23-
},
24-
groups: ['builtin', 'external', ['internal', 'parent'], ['sibling', 'index']],
25-
pathGroups: [
26-
{
27-
pattern: 'react',
28-
group: 'external',
29-
position: 'before',
30-
},
31-
{
32-
pattern: '~**',
33-
group: 'internal',
34-
position: 'before',
35-
},
36-
{
37-
pattern: '~**/**',
38-
group: 'internal',
39-
position: 'before',
40-
},
41-
],
42-
pathGroupsExcludedImportTypes: [],
43-
},
44-
],
45-
'prettier/prettier': [
46-
'error',
47-
{
48-
printWidth: 100,
49-
semi: true,
50-
singleQuote: true,
51-
tabWidth: 2,
52-
trailingComma: 'all',
53-
useTabs: false,
54-
},
55-
],
56-
},
17+
'import/order': [
18+
'error',
19+
{
20+
alphabetize: {
21+
order: 'asc',
22+
caseInsensitive: true,
23+
},
24+
groups: ['builtin', 'external', ['internal', 'parent'], ['sibling', 'index']],
25+
pathGroups: [
26+
{
27+
pattern: 'react',
28+
group: 'external',
29+
position: 'before',
30+
},
31+
{
32+
pattern: '~**',
33+
group: 'internal',
34+
position: 'before',
35+
},
36+
{
37+
pattern: '~**/**',
38+
group: 'internal',
39+
position: 'before',
40+
},
41+
],
42+
pathGroupsExcludedImportTypes: [],
43+
},
44+
],
45+
'prettier/prettier': [
46+
'error',
47+
{
48+
printWidth: 100,
49+
semi: true,
50+
singleQuote: true,
51+
tabWidth: 2,
52+
trailingComma: 'all',
53+
useTabs: true,
54+
},
55+
],
56+
},
5757
};

0 commit comments

Comments
 (0)