Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
options.preferConst to use const instead of var when creating statements
- Loading branch information
Showing
16 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
description: 'uses const instead of var if specified (#653)', | ||
options: { | ||
preferConst: true, | ||
moduleName: 'myBundle' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
define(['external', 'other', 'another'], function (external, other, another) { 'use strict'; | ||
|
||
const a = 1; | ||
const b = 2; | ||
|
||
|
||
const namespace = Object.freeze({ | ||
a: a, | ||
b: b | ||
}); | ||
|
||
console.log( Object.keys( namespace ) ); | ||
|
||
const main = 42; | ||
|
||
return main; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
const external = require('external'); | ||
const other = require('other'); | ||
const another = require('another'); | ||
|
||
const a = 1; | ||
const b = 2; | ||
|
||
|
||
const namespace = Object.freeze({ | ||
a: a, | ||
b: b | ||
}); | ||
|
||
console.log( Object.keys( namespace ) ); | ||
|
||
const main = 42; | ||
|
||
module.exports = main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'external'; | ||
import 'other'; | ||
import 'another'; | ||
|
||
const a = 1; | ||
const b = 2; | ||
|
||
|
||
const namespace = Object.freeze({ | ||
a: a, | ||
b: b | ||
}); | ||
|
||
console.log( Object.keys( namespace ) ); | ||
|
||
const main = 42; | ||
|
||
export default main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const myBundle = (function (external,other,another) { | ||
'use strict'; | ||
|
||
const a = 1; | ||
const b = 2; | ||
|
||
|
||
const namespace = Object.freeze({ | ||
a: a, | ||
b: b | ||
}); | ||
|
||
console.log( Object.keys( namespace ) ); | ||
|
||
const main = 42; | ||
|
||
return main; | ||
|
||
}(external,other,another)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('external'), require('other'), require('another')) : | ||
typeof define === 'function' && define.amd ? define(['external', 'other', 'another'], factory) : | ||
(global.myBundle = factory(global.external,global.other,global.another)); | ||
}(this, function (external,other,another) { 'use strict'; | ||
|
||
const a = 1; | ||
const b = 2; | ||
|
||
|
||
const namespace = Object.freeze({ | ||
a: a, | ||
b: b | ||
}); | ||
|
||
console.log( Object.keys( namespace ) ); | ||
|
||
const main = 42; | ||
|
||
return main; | ||
|
||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import external from 'external'; | ||
import a from 'other'; | ||
import { b } from 'other'; | ||
import { another } from 'another'; | ||
import * as namespace from './namespace.js'; | ||
|
||
console.log( Object.keys( namespace ) ); | ||
|
||
export default 42; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const a = 1; | ||
export const b = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters