Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
- Unbreak format-text.sh
- Remove unused webpack.config.js
- Disable eslint in lint.sh
- yarn lint
  • Loading branch information
lopopolo committed Sep 17, 2019
1 parent cbd027f commit 3a4258b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 118 deletions.
18 changes: 3 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
"version": "0.1.0",
"private": true,
"description": "Logo for Artichoke Ruby",
"keywords": [
"programming language",
"scripting",
"ruby",
"rust",
"assets"
],
"keywords": ["programming language", "scripting", "ruby", "rust", "assets"],
"homepage": "https://github.com/artichoke/logo#readme",
"bugs": "https://github.com/artichoke/logo/issues",
"license": "MIT",
Expand Down Expand Up @@ -50,9 +44,7 @@
"prettier-eslint": "^9.0.0"
},
"babel": {
"presets": [
"@babel/preset-env"
]
"presets": ["@babel/preset-env"]
},
"eslintConfig": {
"env": {
Expand All @@ -62,11 +54,7 @@
"node": true
},
"parser": "babel-eslint",
"plugins": [
"html",
"import",
"prettier"
],
"plugins": ["html", "import", "prettier"],
"extends": [
"airbnb",
"prettier",
Expand Down
30 changes: 20 additions & 10 deletions scripts/format-text.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,36 @@ wrap() {
fi
}

parser() {
if [[ $1 == "js" ]]; then
echo "--parser babel"
elif [[ $1 == "md" ]]; then
echo "--parser markdown"
elif [[ $1 == "yml" ]]; then
echo "--parser yaml"
else
echo "--parser $1"
fi
}

format() {
# shellcheck disable=SC2046
find . -type f \
-and -name "*.$1" \
-and -not -path '*vendor*' \
-and -not -path '*target*' \
-and -not -path '*node_modules*' \
-and -not -path '*spec/ruby*' -print0 |
xargs -0 yarn run prettier --write $(wrap "$1")
-and -not -path '*vendor/*/*' \
-and -not -path '*target/*' \
-and -not -path '*node_modules/*' -print0 |
xargs -0 yarn run prettier $(parser "$1") --write $(wrap "$1")
}

check() {
# shellcheck disable=SC2046
find . -type f \
-and -name "*.$1" \
-and -not -path '*vendor*' \
-and -not -path '*target*' \
-and -not -path '*node_modules*' \
-and -not -path '*spec/ruby*' -print0 |
xargs -0 yarn run prettier --check $(wrap "$1")
-and -not -path '*vendor/*/*' \
-and -not -path '*target/*' \
-and -not -path '*node_modules/*' -print0 |
xargs -0 yarn run prettier $(parser "$1") --check $(wrap "$1")
}

if [[ $# -gt 1 && $1 == '--check' ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ shfmt -f . | grep -v target/ | grep -v node_modules/ | grep -v spec-runner/spec/
./scripts/format-text.sh --format "yaml"
./scripts/format-text.sh --format "yml"
## Lint with eslint
yarn run eslint --fix --ext .html,.js .
# yarn run eslint --fix --ext .html,.js .

# Text sources

Expand Down
92 changes: 0 additions & 92 deletions webpack.config.js

This file was deleted.

0 comments on commit 3a4258b

Please sign in to comment.