Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.

Commit aefceca

Browse files
committed
Lint
1 parent eb632e4 commit aefceca

12 files changed

+51
-42
lines changed

.eslintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ module.exports = {
1010
rules: {
1111
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1212
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13+
14+
// Change line length from 100 -> 120 to have consistency with PHP
15+
'max-len': ['error', 120],
1316
},
1417
parserOptions: {
1518
parser: 'babel-eslint',

babel.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
presets: [
3-
'@vue/cli-plugin-babel/preset'
4-
]
5-
}
3+
'@vue/cli-plugin-babel/preset',
4+
],
5+
};

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
},
1313
"dependencies": {
1414
"@vue/eslint-config-airbnb": "^5.0.2",
15+
"autoprefixer": "^9.7.4",
1516
"core-js": "^3.4.4",
1617
"tailwindcss": "^1.1.4",
17-
"vue": "^2.6.10"
18+
"vue": "^2.6.10",
19+
"tailwindcss-plugins": "^0.3.0"
1820
},
1921
"devDependencies": {
2022
"@storybook/addon-actions": ">=5.3.0",
@@ -32,7 +34,6 @@
3234
"sass": "^1.25.0",
3335
"sass-loader": "^8.0.2",
3436
"storybook-addon-vue-info": "^1.4.1",
35-
"tailwindcss-plugins": "^0.3.0",
3637
"vue-cli-plugin-storybook": "^1.2.0",
3738
"vue-svg-loader": "^0.15.0",
3839
"vue-template-compiler": "^2.6.10"

postcss.config.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
const tailwindcss = require('tailwindcss');
2+
const autoprefixer = require('autoprefixer');
3+
14
module.exports = {
25
plugins: [
3-
require('tailwindcss'),
4-
require('autoprefixer')
5-
]
6-
}
6+
tailwindcss,
7+
autoprefixer,
8+
],
9+
};

src/assets/svgs/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import svgCloseIcon from './close-icon.svg';
22

33
export default {
4-
svgCloseIcon
5-
}
4+
svgCloseIcon,
5+
};

src/components.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import TextField from './components/TextField.vue';
33

44
export default {
55
BaseButton,
6-
TextField
7-
}
6+
TextField,
7+
};

src/components/BaseAlert.vue

+11-10
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
</div>
1717
</template>
1818
<script>
19-
import SvgCloseIcon from './../assets/svgs/close-icon.svg';
20-
import BaseTag from './BaseTag';
19+
import SvgCloseIcon from '../assets/svgs/close-icon.svg';
20+
import BaseTag from './BaseTag.vue';
21+
2122
export default {
2223
name: 'TextField',
2324
components: {
2425
BaseTag,
25-
SvgCloseIcon
26+
SvgCloseIcon,
2627
},
2728
props: {
2829
/**
@@ -44,15 +45,15 @@ export default {
4445
variant: {
4546
type: String,
4647
default: 'default',
47-
validator: function (value) {
48+
validator(value) {
4849
return ['default', 'success', 'error', 'warning', 'info'].includes(value);
49-
}
50-
}
50+
},
51+
},
5152
},
5253
computed: {
5354
classObject() {
5455
return this.variant !== 'default' && `alert--${this.variant}`;
55-
}
56+
},
5657
},
5758
methods: {
5859
onClose($event) {
@@ -61,9 +62,9 @@ export default {
6162
* @event close-alert
6263
* @type {$event}
6364
*/
64-
this.$emit('close-alert', $event)
65-
}
66-
}
65+
this.$emit('close-alert', $event);
66+
},
67+
},
6768
};
6869
</script>
6970
<style lang="scss" scoped>

src/components/BaseTag.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export default {
3333
variant: {
3434
type: String,
3535
default: 'default',
36-
validator: function (value) {
36+
validator(value) {
3737
return ['default', 'success', 'error', 'warning', 'info'].includes(value);
38-
}
38+
},
3939
},
4040
},
4141
computed: {
@@ -46,7 +46,7 @@ export default {
4646
*/
4747
classObject() {
4848
return this.variant === 'default' ? '' : `tag--${this.variant}`;
49-
}
49+
},
5050
},
5151
};
5252
</script>

src/components/TextField.vue

+11-10
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,32 @@ export default {
1818
*/
1919
variant: {
2020
type: String,
21-
default: ''
21+
default: '',
2222
},
2323
/**
24-
* The value the v-model directive utilizes, see https://vuejs.org/v2/guide/components.html#Using-v-model-on-Components
24+
* The value the v-model directive utilizes
25+
* @see https://vuejs.org/v2/guide/components.html#Using-v-model-on-Components
2526
*/
2627
value: {
2728
type: String,
28-
default: ''
29+
default: '',
2930
},
3031
/**
3132
* The value used for the inner `<input>`'s placeholder html attribute
3233
*/
3334
placeholder: {
3435
type: String,
35-
default: 'Text Field'
36-
}
36+
default: 'Text Field',
37+
},
3738
},
3839
computed: {
3940
classNames() {
4041
return {
4142
'opacity-50 input--disabled': this.variant === 'disabled',
4243
'input--error': this.variant === 'error',
4344
'input--empty': this.value === '',
44-
}
45-
}
45+
};
46+
},
4647
},
4748
methods: {
4849
onInput($event) {
@@ -51,9 +52,9 @@ export default {
5152
* @event input
5253
* @type {$event.target.value}
5354
*/
54-
this.$emit('input', $event.target.value)
55-
}
56-
}
55+
this.$emit('input', $event.target.value);
56+
},
57+
},
5758
};
5859
</script>
5960
<style lang="scss" scoped>

src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import Components from './components';
2-
import config from './../tailwind.config.js';
3-
import SvgIcons from './assets/svgs'
2+
import config from '../tailwind.config';
3+
import SvgIcons from './assets/svgs';
44

55
export default {
66
config,
77
...Components,
88
icons: {
9-
...SvgIcons
10-
}
9+
...SvgIcons,
10+
},
1111
};

tailwind.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = {
6363
default: '0.375rem',
6464
md: '0.5rem',
6565
lg: '0.75rem',
66-
full: '9999px'
66+
full: '9999px',
6767
},
6868
fontSize: {
6969
xs: '.75rem',

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -2689,7 +2689,7 @@ atob@^2.1.2:
26892689
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
26902690
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
26912691

2692-
autoprefixer@^9.4.5, autoprefixer@^9.7.2:
2692+
autoprefixer@^9.4.5, autoprefixer@^9.7.2, autoprefixer@^9.7.4:
26932693
version "9.7.4"
26942694
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.7.4.tgz#f8bf3e06707d047f0641d87aee8cfb174b2a5378"
26952695
integrity sha512-g0Ya30YrMBAEZk60lp+qfX5YQllG+S5W3GYCFvyHTvhOki0AEQJLPEcIuGRsqVwLi8FvXPVtwTGhfr38hVpm0g==

0 commit comments

Comments
 (0)