-
-
Notifications
You must be signed in to change notification settings - Fork 247
Chore: add build step to bundle client-side assets #588
Changes from 9 commits
c2b7e43
d348be0
00386b9
a9e37cc
bb5bad7
4289907
8a8b0a2
8d54bd5
3cfa9ab
fe028cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-react", | ||
["@babel/preset-env", { | ||
"modules": false, | ||
"targets": { | ||
"browsers": ["last 3 versions"] | ||
} | ||
}] | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
js/app/eslint.js | ||
js/app/espree.js | ||
js/app/parser/index.built.js | ||
node_modules | ||
vendor | ||
_site | ||
assets/build | ||
src/js/eslint.js | ||
src/js/espree.js | ||
!.*.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
root: true, | ||
extends: ["eslint"], | ||
parserOptions: { | ||
ecmaVersion: 2019 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd ideally like to start using ES2015+ features, but I do think it's important we stick to features available in Espree so that we can dogfood it in our site. Does limiting ourselves to features available in Espree (so, features that have reached stage 4 and are supported by the parser) sound like a good policy? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should document this in the README (and maybe also create a CONTRIBUTING.md document) |
||
}, | ||
overrides: [ | ||
{ | ||
files: ["src/js/**/*.{js,jsx}"], | ||
plugins: ["react", "jsx-a11y"], | ||
extends: ["plugin:react/recommended", "plugin:jsx-a11y/recommended"], | ||
parserOptions: { | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true | ||
} | ||
}, | ||
settings: { | ||
react: { | ||
version: "15.0.1" | ||
} | ||
}, | ||
rules: { | ||
|
||
// Disable rules that the codebase doesn't currently follow. | ||
// It might be a good idea to enable these in the future. | ||
"jsx-a11y/no-onchange": "off", | ||
"react/prop-types": "off" | ||
} | ||
}, | ||
{ | ||
files: ["assets/js/*.js"], | ||
parserOptions: { | ||
ecmaVersion: 5, | ||
sourceType: "script" | ||
} | ||
}, | ||
{ | ||
files: ["assets/js/*.js", "src/js/**/*.{js,jsx}"], | ||
env: { | ||
browser: true, | ||
node: false | ||
}, | ||
rules: { | ||
|
||
// Disable rules that assume an ES6 environment. | ||
// This is not a complete list. More rules should be added as problems are encountered. | ||
"no-var": "off", | ||
"object-shorthand": "off", | ||
"prefer-arrow-callback": "off", | ||
"prefer-rest-params": "off", | ||
"prefer-template": "off", | ||
|
||
// Disable eslint-plugin-node rules from eslint-config-eslint | ||
"no-process-exit": "off", | ||
"node/no-deprecated-api": "off", | ||
"node/no-extraneous-require": "off", | ||
"node/no-missing-require": "off", | ||
"node/no-unpublished-bin": "off", | ||
"node/no-unpublished-require": "off", | ||
"node/no-unsupported-features/es-builtins": "off", | ||
"node/no-unsupported-features/es-syntax": "off", | ||
"node/no-unsupported-features/node-builtins": "off", | ||
"node/process-exit-as-throw": "off", | ||
"node/shebang": "off", | ||
"node/no-extraneous-import": "off", | ||
"node/no-missing-import": "off", | ||
"node/no-unpublished-import": "off", | ||
|
||
// Disable rules that the codebase doesn't currently follow. | ||
"require-jsdoc": "off" | ||
} | ||
} | ||
] | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules/ | ||
_site/ | ||
assets/build | ||
Gemfile.lock | ||
.jekyll-metadata | ||
npm-debug.log | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ exclude: | |
- Gemfile.lock | ||
- package.json | ||
- node_modules | ||
- src | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it's not ignoring assets/build, this ensures Jekyll waits to regenerate the site until after Webpack finishes and outputs the bundles (I don't think this really matters what order they run in, but this prevents Jekyll from regenerating the site when |
||
- sitemap.xml | ||
- feed.xml | ||
- docs/0.24.1 | ||
|
@@ -24,4 +25,4 @@ exclude: | |
- docs/2.13.1 | ||
- docs/3.0.0 | ||
- docs/4.0.0 | ||
- docs/5.0.0 | ||
- docs/5.0.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
title: "ESLint - Pluggable JavaScript linter" | ||
repository: "eslint/eslint.github.io" | ||
exclude: [ | ||
'node_modules', | ||
'bower_components', | ||
'vendor' | ||
] | ||
exclude: | ||
- node_modules | ||
- src | ||
- vendor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes the Travis CI build |
||
description: "A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease." | ||
permalink: /blog/:year/:month/:title | ||
plugins: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
//----------------------------------------------------------------------------- | ||
|
||
const fs = require("fs"); | ||
const fetch = require("node-fetch"); | ||
const fetch = require("node-fetch"); // eslint-disable-line node/no-unpublished-require | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why this is warning at the moment. Any ideas? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this isn't the rule's current behavior, but it seems like it shouldn't report when the root package.json has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mysticatea Does that make sense? Maybe I'm missing something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we disable these rules in eslintrc? (since it is not a node lib.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aladdin-add’s suggestion makes sense to me. Will disable for the website. |
||
|
||
//----------------------------------------------------------------------------- | ||
// Data | ||
|
@@ -30,7 +30,7 @@ const sponsors = { | |
backers: [] | ||
}; | ||
|
||
const graphqlEndpoint = 'https://api.opencollective.com/graphql/v2'; | ||
const graphqlEndpoint = "https://api.opencollective.com/graphql/v2"; | ||
|
||
const graphqlQuery = `{ | ||
account(slug: "eslint") { | ||
|
@@ -65,9 +65,9 @@ const graphqlQuery = `{ | |
|
||
// fetch the data | ||
const result = await fetch(graphqlEndpoint, { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify({ query: graphqlQuery }), | ||
method: "POST", | ||
headers: { "Content-Type": "application/json" }, | ||
body: JSON.stringify({ query: graphqlQuery }) | ||
}); | ||
const orders = await result.json().then(res => res.data.account.orders.nodes); | ||
|
||
|
@@ -78,7 +78,7 @@ const graphqlQuery = `{ | |
name: order.fromAccount.name, | ||
url: order.fromAccount.website, | ||
image: order.fromAccount.imageUrl, | ||
monthlyDonation: order.frequency === 'year' ? Math.round(order.amount.value * 100 / 12) : order.amount.value * 100, | ||
monthlyDonation: order.frequency === "year" ? Math.round(order.amount.value * 100 / 12) : order.amount.value * 100, | ||
totalDonations: order.totalDonations.value * 100 | ||
}; | ||
|
||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we want to do for this? Relevant discussion: #543
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't want to think about this yet, we can also specify
forceAllTransforms: true
, and it will compile everything to be ES5-compatible.