Skip to content

Commit

Permalink
Merge branch 'canary' into lint-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekbh authored Sep 1, 2021
2 parents 78e095e + c1dbc12 commit 09b3f7b
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/basic-features/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export async function getStaticProps() {
## Exposing Environment Variables to the Browser
By default all environment variables loaded through `.env.local` are only available in the Node.js environment, meaning they won't be exposed to the browser.
By default environment variables are only available in the Node.js environment, meaning they won't be exposed to the browser.
In order to expose a variable to the browser you have to prefix the variable with `NEXT_PUBLIC_`. For example:
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "11.1.2"
"version": "11.1.3-canary.0"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/create-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export async function createApp({
* TypeScript projects will have type definitions and other devDependencies.
*/
if (typescript) {
devDependencies.push('typescript', '@types/react')
devDependencies.push('typescript', '@types/react', '@types/node')
}
/**
* Install package.json dependencies if they exist.
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "11.1.2",
"@next/eslint-plugin-next": "11.1.3-canary.0",
"@rushstack/eslint-patch": "^1.0.6",
"@typescript-eslint/parser": "^4.20.0",
"eslint-import-resolver-node": "^0.3.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin-next/lib/rules/next-script-for-ga.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ module.exports = {
// https://developers.google.com/analytics/devguides/collection/analyticsjs#the_google_analytics_tag
// https://developers.google.com/tag-manager/quickstart
if (
attributes.has('dangerouslySetInnerHTML') &&
attributes.value('dangerouslySetInnerHTML')[0]
attributes.value('dangerouslySetInnerHTML') &&
attributes.value('dangerouslySetInnerHTML').length > 0
) {
const htmlContent =
attributes.value('dangerouslySetInnerHTML')[0].value.quasis &&
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
12 changes: 6 additions & 6 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -66,10 +66,10 @@
"dependencies": {
"@babel/runtime": "7.15.3",
"@hapi/accept": "5.0.2",
"@next/env": "11.1.2",
"@next/polyfill-module": "11.1.2",
"@next/react-dev-overlay": "11.1.2",
"@next/react-refresh-utils": "11.1.2",
"@next/env": "11.1.3-canary.0",
"@next/polyfill-module": "11.1.3-canary.0",
"@next/react-dev-overlay": "11.1.3-canary.0",
"@next/react-refresh-utils": "11.1.3-canary.0",
"@node-rs/helper": "1.2.1",
"assert": "2.0.0",
"ast-types": "0.13.2",
Expand Down Expand Up @@ -154,7 +154,7 @@
"@babel/traverse": "7.15.0",
"@babel/types": "7.15.0",
"@napi-rs/cli": "1.1.0",
"@next/polyfill-nomodule": "11.1.2",
"@next/polyfill-nomodule": "11.1.3-canary.0",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@taskr/watch": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-dev-overlay",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"description": "A development-only overlay for developing React applications.",
"repository": {
"url": "vercel/next.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "11.1.2",
"version": "11.1.3-canary.0",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
1 change: 1 addition & 0 deletions test/integration/create-next-app/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ describe('create next app', () => {
'react-dom',
])
expect(Object.keys(pkgJSON.devDependencies)).toEqual([
'@types/node',
'@types/react',
'eslint',
'eslint-config-next',
Expand Down
30 changes: 30 additions & 0 deletions test/unit/eslint-plugin-next/next-script-for-ga.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,35 @@ ruleTester.run('sync-scripts', rule, {
},
],
},
{
code: `
export class Blah extends Head {
createGoogleAnalyticsMarkup() {
return {
__html: \`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-148481588-2');\`,
};
}
render() {
return (
<div>
<h1>Hello title</h1>
<script dangerouslySetInnerHTML={this.createGoogleAnalyticsMarkup()} />
<script async src='https://www.google-analytics.com/analytics.js'></script>
</div>
);
}
}`,
errors: [
{
message: ERROR_MSG,
type: 'JSXOpeningElement',
},
],
},
],
})

0 comments on commit 09b3f7b

Please sign in to comment.