Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update linter version and still observe max line length #355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,39 @@
extends:
- eslint-config-shakacode
- prettier
# Not sure if below is better Alex
# - plugin:prettier/recommended
# - prettier/flowtype
# - prettier/react
# - prettier/standard

plugins:
- prettier
- prettier

globals:
__DEBUG__: true
__BOOTSTRAP_CONFIG__: true

ecmaFeatures:
restParams: true

rules:
prettier/prettier: "error"

space-before-function-paren: [2, "never"]
import/no-unresolved: 0
no-underscore-dangle: [ "error", { "allow": [ "__BOOTSTRAP_CONFIG__", "__DEBUG__", "_babelPolyfill" ] } ]

# https://github.com/benmosher/eslint-plugin-import/issues/340
import/no-extraneous-dependencies: 0

# http://eslint.org/docs/rules/max-len
# https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js#L128
# Almost identical to airbnb's version, but adds ignore of `import` statements and sets ignoreStrings: false
max-len:
- 2
-
code: 100
tabWidth: 2
ignoreUrls: true
ignoreComments: false
ignoreRegExpLiterals: true
ignoreStrings: false
ignoreTemplateLiterals: false
ignorePattern: ^import\\s+
6 changes: 4 additions & 2 deletions examples/multiple-entries/webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ module.exports = {
'webpack-hot-middleware/client',
'tether',
'font-awesome-loader',
`bootstrap-loader/lib/bootstrap.loader?configFilePath=${__dirname}/bs3.yml!bootstrap-loader/no-op.js`,
`bootstrap-loader/lib/bootstrap.loader?configFilePath=` +
`${__dirname}/bs3.yml!bootstrap-loader/no-op.js`,
'./app/scripts/app',
],
bs4: [
'webpack-hot-middleware/client',
'tether',
'font-awesome-loader',
`bootstrap-loader/lib/bootstrap.loader?configFilePath=${__dirname}/bs4.yml!bootstrap-loader/no-op.js`,
`bootstrap-loader/lib/bootstrap.loader?configFilePath=` +
`${__dirname}/bs4.yml!bootstrap-loader/no-op.js`,
'./app/scripts/app',
],
},
Expand Down
6 changes: 4 additions & 2 deletions examples/multiple-entries/webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ module.exports = {
entry: {
bs3: [
'font-awesome-loader',
`bootstrap-loader/lib/bootstrap.loader?extractStyles&configFilePath=${__dirname}/bs3.yml!bootstrap-loader/no-op.js`,
`bootstrap-loader/lib/bootstrap.loader?extractStyles&configFilePath=` +
`${__dirname}/bs3.yml!bootstrap-loader/no-op.js`,
'tether',
'./app/scripts/app',
],
bs4: [
'font-awesome-loader',
`bootstrap-loader/lib/bootstrap.loader?extractStyles&configFilePath=${__dirname}/bs4.yml!bootstrap-loader/no-op.js`,
`bootstrap-loader/lib/bootstrap.loader?extractStyles&configFilePath=` +
`${__dirname}/bs4.yml!bootstrap-loader/no-op.js`,
'tether',
'./app/scripts/app',
],
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"start": "npm run lint && npm run clean && npm run dev",
"dev": "babel --watch --out-dir lib src",
"build": "babel --out-dir lib src",
"lint": "eslint --ext .js .",
"lint": "eslint --ext '*.js,*.test.js' .",
"prettier-eslint": "prettier-eslint --ext '*.js,*.test.js' .",
"clean": "rm -rf lib",
"format": "prettier \"{examples,node_package,src}/**/*.@(js|jsx|json|css|scss)\" --write",
"format": "prettier \"{examples,node_package,src}/**/*.@(js|jsx|json|css|scss)\" \"!**/public/**\" --write",
"prerelease": "npm run lint && npm run test && npm run clean && npm run build",
"preversion": "npm run prerelease",
"prepublish": "npm run prerelease",
Expand Down Expand Up @@ -61,11 +62,11 @@
"babel-tape-runner": "^2.0.1",
"eslint": "4.19.1",
"eslint-config-prettier": "2.9.0",
"eslint-config-shakacode": "16.0.1",
"eslint-plugin-import": "2.11.0",
"eslint-plugin-jsx-a11y": "6.0.3",
"eslint-config-shakacode": "file:../../style-guide-javascript/packages/eslint-config-shakacode",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "2.6.0",
"eslint-plugin-react": "7.7.0",
"eslint-plugin-react": "^7.9.1",
"mini-css-extract-plugin": "0.4.0",
"prettier": "1.12.1",
"tap-spec": "^4.1.1",
Expand Down
6 changes: 4 additions & 2 deletions src/bootstrap.loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ module.exports.pitch = function(source) {
config.bootstrapPath = bootstrapPath || resolveModule(bootstrapNPMModule);
logger.debug(`Bootstrap module location (abs): ${config.bootstrapPath}`);
if (!config.bootstrapPath) {
const msg = `Could not resolve module '${bootstrapNPMModule}' which must be installed when bootstrap version is configured to v${bootstrapVersion}.
const msg = `Could not resolve module '${bootstrapNPMModule}' which must be
installed when bootstrap version is configured to v${bootstrapVersion}.
You must install 'bootstrap' for bootstrap v4 or 'bootstrap-sass' for bootstrap v3.
You can also specify the location manually by specifying 'bootstrapPath' in bootstrap-loader's query string.
You can also specify the location manually by specifying 'bootstrapPath' in
bootstrap-loader's query string.
See https://github.com/shakacode/bootstrap-loader/blob/master/README.md#usage.`;
throw new Error(msg);
}
Expand Down
Loading