Linter setup (#50)

* Setup prettier and eslint

* npm lint scripts
This commit is contained in:
Yannis Petitot
2019-10-12 22:29:04 +02:00
committed by yadpe
parent e561c97032
commit 4cdaf057f0
7 changed files with 665 additions and 180 deletions
+20
View File
@@ -0,0 +1,20 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 2
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
+5
View File
@@ -0,0 +1,5 @@
dist
build
node_modules
assets
config
+36
View File
@@ -0,0 +1,36 @@
{
"extends": ["airbnb", "prettier", "prettier/react"],
"env": {
"browser": true,
"node": true
},
"rules": {
"import/no-extraneous-dependencies": ["error", {
"devDependencies": [
"config/**/*.js",
"scripts/**/*.js"
]
}],
"import/extensions": [
"error",
"always",
{
"js": "never",
"jsx": "never",
"mjs": "never",
"ts": "never",
"tsx": "never"
}
],
"react/jsx-filename-extension": ["error", { "extensions": [".jsx", ".tsx"] }],
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-spreading": "off",
"object-curly-newline":"off",
"no-plusplus":"off"
},
"settings": {
"import/resolver": {
"node": { "extensions": [".js", ".jsx", ".mjs", ".json", ".d.ts", ".ts", ".tsx"] }
}
}
}
+5
View File
@@ -0,0 +1,5 @@
dist
build
node_modules
assets
config
+13
View File
@@ -0,0 +1,13 @@
{
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "all",
"arrowParens": "avoid",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"proseWrap": "preserve"
}
+560 -158
View File
File diff suppressed because it is too large Load Diff
+26 -22
View File
@@ -11,18 +11,20 @@
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js",
"lint": "eslint src/App/**",
"lint": "npm run lint:prettier && npm run lint:es",
"lint:fix": "npm run lint:fix:prettier && npm run lint:fix:es",
"lint:prettier": "prettier --check '**/*.{json,jsx,tsx,mjs,js,ts}'",
"lint:fix:prettier": "prettier --write '**/*.{json,jsx,tsx,mjs,js,ts}'",
"lint:es": "eslint '**/*.{js,jsx,mjs,ts,tsx}'",
"lint:fix:es": "eslint --fix '**/*.{js,jsx,mjs,ts,tsx}'",
"go": "electron .",
"dist": "npm run build && npx npx electron-builder --win --linux --ia32",
"dist-win": "npm run build && npx electron-builder build --win --ia32",
"dist-linux": "npm run build && npx electron-builder build --linux --ia32",
"dist-mac": "npm run build && npx electron-builder build --mac --x64",
"gh-publish": "npm run build && npx electron-builder build --win --linux --mac --ia32 --x64 -p always",
"dist:gh-publish": "npm run build && npx electron-builder build --win --linux --mac --ia32 --x64 -p always",
"electron-dev": "cross-env ELECTRON_START_URL=http://localhost:3000 electron ."
},
"eslintConfig": {
"extends": "react-app"
},
"repository": {
"type": "git",
"url": "https://github.com/yadPe/beatconnect_client.git"
@@ -85,9 +87,6 @@
"dependencies": {
"@babel/core": "7.4.3",
"@svgr/webpack": "4.1.0",
"@typescript-eslint/eslint-plugin": "1.6.0",
"@typescript-eslint/parser": "1.6.0",
"babel-eslint": "10.0.1",
"babel-jest": "^24.8.0",
"babel-loader": "8.0.5",
"babel-plugin-named-asset-import": "^0.3.2",
@@ -101,24 +100,11 @@
"electron-is-dev": "^1.1.0",
"electron-log": "^3.0.7",
"electron-updater": "^4.1.2",
"eslint": "^5.16.0",
"eslint-config-react-app": "^4.0.1",
"eslint-loader": "2.1.2",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-react": "7.12.4",
"eslint-plugin-react-hooks": "^1.5.0",
"file-loader": "3.0.1",
"fs-extra": "^7.0.1",
"html-webpack-plugin": "4.0.0-beta.5",
"identity-obj-proxy": "3.0.0",
"irc": "git+https://github.com/yadPe/node-irc.git",
"is-wsl": "^1.1.0",
"jest": "24.7.1",
"jest-environment-jsdom-fourteen": "0.1.0",
"jest-resolve": "24.7.1",
"jest-watch-typeahead": "0.3.0",
"long": "^4.0.0",
"mini-css-extract-plugin": "0.5.0",
"optimize-css-assets-webpack-plugin": "5.0.1",
@@ -135,7 +121,6 @@
"react-dom": "^16.8.6",
"react-jss": "^8.6.1",
"react-redux": "^7.1.0",
"react-visibility-sensor": "^5.1.1",
"react-window": "^1.8.5",
"redux": "^4.0.1",
"resolve": "1.10.0",
@@ -155,9 +140,28 @@
"workbox-webpack-plugin": "4.2.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "1.6.0",
"@typescript-eslint/parser": "1.6.0",
"babel-eslint": "10.0.1",
"cross-env": "^6.0.3",
"electron": "^5.0.5",
"electron-builder": "^20.44.4",
"eslint": "^6.1.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-react-app": "^4.0.1",
"eslint-config-prettier": "^6.4.0",
"eslint-loader": "2.1.2",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^1.7.0",
"is-wsl": "^1.1.0",
"jest": "24.7.1",
"jest-environment-jsdom-fourteen": "0.1.0",
"jest-resolve": "24.7.1",
"jest-watch-typeahead": "0.3.0",
"prettier": "^1.18.2",
"typescript": "^3.5.3"
},
"browserslist": {