@designbycosmic/cosmic-react-common-components
v0.6.7
Published
A collection of commonly used react components.
Downloads
13
Readme
cosmic-package-template
A template for cosmic packages w/ eslint, prettier, babel, etc.
You may need to install React eslint packages and add to the config:
yarn add eslint-plugin-react -D
yarn add react prop-types
.eslintrc.js
module.exports = {
"extends": [
"airbnb",
"plugin:prettier/recommended",
"prettier/react"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react",
"prettier"
],
rules: {
// allow .jsx in .js files
"react/jsx-filename-extension": [
"error",
{
"extensions": [
".js",
".jsx"
]
}
],
}
}
Or Vue:
yarn add eslint-plugin-vue -D
yarn add vue
.eslintrc.js
module.exports = {
"parserOptions": {"parser": "babel-eslint"},
"extends": [
"airbnb",
"plugin:prettier/recommended",
"plugin:vue/recommended"
],
"plugins": [
"prettier",
"import"
],
"rules": {
"prettier/prettier": "error",
"vue/html-self-closing": [
"error",
{
"html": {
"void": "always",
"normal": "always",
"component": "always"
},
"svg": "always",
"math": "always"
}
],
"vue/max-attributes-per-line": [
2,
{
"singleline": 20,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}
]
}
}