Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit 1c5647b

Browse files
committed
Release 6.0.0
1 parent c283568 commit 1c5647b

File tree

4 files changed

+222
-223
lines changed

4 files changed

+222
-223
lines changed

README.md

Lines changed: 136 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,136 @@
1-
# @oracle/eslint-config-oraclejet 5.2.0
2-
3-
This package contains the ESLint configurations used by the Oracle JET project. These configurations come in two flavors:
4-
5-
* es5: this configuration is used by the JET runtime code base, which is authored in ES5.
6-
* es6: this configuration is used by the JET tooling code base, which consists of a collection of Node-based packages that are authored in ES6.
7-
8-
These ESLint configurations are based on the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), which defines thorough JavaScript coding guidelines with the goal of ensuring a clean, consistent code base. The Oracle JET configurations introduce some deltas on top of the base ESLint configurations provided by Airbnb, as explained below.
9-
10-
Application developers are welcome to use the Oracle JET ESLint configurations with their own code bases, though be aware that several of the changes are fairly specific to JET (e.g. use of underscore prefixes), so please review the information below before adoption. A better option for JET-based applications that want to follow a similar coding standard without picking up the JET-specific quirks would be to use [Airbnb's ESLint configurations](https://www.npmjs.com/package/eslint-config-airbnb) directly.
11-
12-
## Deltas to the Airbnb ESLint Configurations
13-
14-
The following sections list the modifications that the Oracle JET ESLint configurations apply on top of the base Airbnb configurations.
15-
16-
### 1. Common Deltas
17-
18-
The items in this section apply to both of our configurations (ES5 and ES6).
19-
20-
#### 1.1 Underscore prefixes are used for private variables
21-
22-
_ESLint rule change_: [no-underscore-dangle](http://eslint.org/docs/rules/no-underscore-dangle) is disabled.
23-
24-
While the use of underscore prefixes to identify "private" properties (functions and variables) is a [controversial](https://github.com/airbnb/javascript/issues/1024) [topic](https://github.com/airbnb/javascript/issues/1089), the JET code base uses this convention. We understand that naming conventions are not a robust solution for enforcing privacy. To help mitigate some of the risk, the JET runtime code base is run through the [Closure Compiler](https://developers.google.com/closure/compiler/), which mangles private property names.
25-
26-
The JET team is evaluating other [approaches to private properties](https://curiosity-driven.org/private-properties-in-javascript), and would encourage our clients to do the same.
27-
28-
#### 1.2 Anonymous function expressions are allowed
29-
30-
_ESLint rule change_: [func-names](http://eslint.org/docs/rules/func-names) is disabled.
31-
32-
The Airbnb ESLint rules enforce that all function expressions must be named. This requires duplication when assigning function expressions, e.g.:
33-
34-
```javascript
35-
Foo.prototype.doSomething = function doSomething() { };
36-
```
37-
38-
Given that ES6 specifies new rules for [function name inference](http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation), the JET code base allows anonymous function expressions.
39-
40-
Note that while modern browsers support function name inference, the use of anonymous function expressions can make debugging more challenging on older browsers (e.g. IE11).
41-
42-
#### 1.3 Functions may be used before they are defined (in non-hoisting situations)
43-
44-
_ESLint rule change_: [no-use-before-define](http://eslint.org/docs/rules/no-use-before-define) is disabled for functions.
45-
46-
Robert Martin's [Clean Code](https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882) promotes the notion that code should read like a top-down narrative, where higher level functions appear at the top of the module, followed by functions of increasingly lower levels of abstraction that are used to implement the preceding higher level functions. This approach to code organization is dubbed "The Stepdown Rule".
47-
48-
Unfortunately, the no-use-before-define ESLint rule is not compatible with this approach.
49-
50-
In theory, no-use-before-define intends to protect developers from relying on function hoisting behavior like this:
51-
52-
```javascript
53-
// Call function that has not yet been defined
54-
doSomething();
55-
56-
// Define function somewhere later in the same scope
57-
function doSomething() { }
58-
```
59-
The above code relies on the fact that the definition of the doSomething function will be hoisted to the top of the scope, above the doSomething() call. This is reasonable to flag.
60-
61-
However, the no-use-before-define rule additionally reports the following code as a violation:
62-
63-
```javascript
64-
function doSomething() {
65-
doSomeLowerLevelThing();
66-
}
67-
68-
function doSomeLowerLevelThing() {}
69-
```
70-
71-
Although the above code does not rely on function hoisting, no-use-before-define still considers this code to be invalid, which prohibits the use of Martin's Stepdown Rule.
72-
73-
The JET team likes the Stepdown Rule enough to justify disabling the no-use-before-define rule defined by Airbnb's ESLint config. (We disable the rule just for functions, not for variables.)
74-
75-
If in the future we find (or implement) an ESLint rule that can distinguish between hoisting-dependent vs. hoisting-independent usages, we may start treating hoisting-dependent use-before-define cases as violations. As such, we encourage JET developers to limit reliance on function hoisting, even though this is not currently enforced.
76-
77-
78-
#### 1.4. Function declarations are allowed
79-
80-
_ESLint rule change_: None.
81-
82-
The Airbnb style guide prefers the use of [function expressions instead of function declarations](https://github.com/airbnb/javascript#functions--declarations) due to concerns over function [hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html) confusion.
83-
84-
We have found function declarations to be readable and have increased complexity in our code base. As such, we continue to leverage this language feature.
85-
86-
Note that it appears that Airbnb eventually plans to enforce the use of function expressions via the [func-style](http://eslint.org/docs/rules/func-style) rule. However, this is not yet enforced, so JET does not yet make any rule changes relating to this.
87-
88-
#### 1.5 Platform-specific line breaks are allowed
89-
90-
_ESLint rule change_: [linebreak-style](http://eslint.org/docs/rules/linebreak-style) is disabled.
91-
92-
Rather than enforce a consistent line break style via ESLint, we prefer to deal with this at the source control layer. This allows our developers to do development (including running ESLint) on their platform of choice without having to worry about line breaks.
93-
94-
#### 1.6 The unary increment/decrement operators may be used in for loops
95-
96-
_ESLint rule change_: [no-plusplus](http://eslint.org/docs/rules/no-plusplus) is disabled for afterthoughts in for loops.
97-
98-
The Airbnb style guide raises various [concerns about the use of ++ and --](https://github.com/airbnb/javascript#variables--unary-increment-decrement). While we agree with these concerns, we are comfortable with allowing these operators in for loops.
99-
100-
Note that, like Airbnb, we prefer [higher-order functions instead of loops](https://github.com/airbnb/javascript#iterators--nope).
101-
102-
### 2. ES6-specific Deltas
103-
104-
The following changes are specific to the ES6 version of the Oracle JET ESLint configuration, used by JET's Node-based tooling packages.
105-
106-
#### 2.1 Console logging is allowed
107-
108-
_ESLint rule change_: [no-console](http://eslint.org/docs/rules/no-console) is disabled.
109-
110-
For the moment, our ES6 configuration is exclusively used by JET's Node-based tooling modules. These modules use console logging to communicate with the end user.
111-
112-
Note we are considering generalizing our ES6 rules to apply to browser code as well, in which case we would change to (globally) disallowing console logging.
113-
114-
#### 2.2 Use strict is allowed
115-
116-
_ESLint rule change_: [strict](http://eslint.org/docs/rules/strict) is disabled.
117-
118-
The Airbnb ESLint config forbids the use of 'use strict' as Airbnb relies on [Babel](https://babeljs.io/) to automatically insert this construct as needed. Since JET's build infrastructure does not automatically insert 'use strict', our ESLint config allows developers to do this manually.
119-
120-
#### 2.3 Dangling commas are not required
121-
122-
_ESLint rule change_: [comma-dangle](http://eslint.org/docs/rules/comma-dangle) is disabled.
123-
124-
Airbnb's (ES6) style guide mandates the use of dangling commas for the purpose of having cleaner git diffs. We find that dangling commas can be slightly less readable and slightly more confusing for developers, so we prefer to optimize for reading over diff'ing.
125-
126-
#### 2.4 Unresolved imports are (temporarily) allowed
127-
128-
_ESLint rule change_: [import/no-unresolved](http://eslint.org/docs/rules/import/no-unresolved) is disabled.
129-
130-
While we would like to leave this rule enabled, we are currently seeing some false positives triggered by this rule. As such, we are temporarily disabling this while we get to the bottom of the violations. We plan to re-enable this rule in a future version of our eslint-config-oraclejet.
131-
132-
## [Contributing](https://github.com/oracle/eslint-config-oraclejet/tree/master/CONTRIBUTING.md)
133-
Oracle JET is an open source project. Pull Requests are currently not being accepted. See [CONTRIBUTING](https://github.com/oracle/eslint-config-oraclejet/tree/master/CONTRIBUTING.md) for details.
134-
135-
## [License](https://github.com/oracle/eslint-config-oraclejet/tree/master/LICENSE.md)
136-
Copyright (c) 2014, 2018 Oracle and/or its affiliates The Universal Permissive License (UPL), Version 1.0
1+
# @oracle/eslint-config-oraclejet 6.0.0
2+
3+
This package contains the ESLint configurations used by the Oracle JET project. These configurations come in two flavors:
4+
5+
* es5: this configuration is used by the JET runtime code base, which is authored in ES5.
6+
* es6: this configuration is used by the JET tooling code base, which consists of a collection of Node-based packages that are authored in ES6.
7+
8+
These ESLint configurations are based on the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), which defines thorough JavaScript coding guidelines with the goal of ensuring a clean, consistent code base. The Oracle JET configurations introduce some deltas on top of the base ESLint configurations provided by Airbnb, as explained below.
9+
10+
Application developers are welcome to use the Oracle JET ESLint configurations with their own code bases, though be aware that several of the changes are fairly specific to JET (e.g. use of underscore prefixes), so please review the information below before adoption. A better option for JET-based applications that want to follow a similar coding standard without picking up the JET-specific quirks would be to use [Airbnb's ESLint configurations](https://www.npmjs.com/package/eslint-config-airbnb) directly.
11+
12+
## Deltas to the Airbnb ESLint Configurations
13+
14+
The following sections list the modifications that the Oracle JET ESLint configurations apply on top of the base Airbnb configurations.
15+
16+
### 1. Common Deltas
17+
18+
The items in this section apply to both of our configurations (ES5 and ES6).
19+
20+
#### 1.1 Underscore prefixes are used for private variables
21+
22+
_ESLint rule change_: [no-underscore-dangle](http://eslint.org/docs/rules/no-underscore-dangle) is disabled.
23+
24+
While the use of underscore prefixes to identify "private" properties (functions and variables) is a [controversial](https://github.com/airbnb/javascript/issues/1024) [topic](https://github.com/airbnb/javascript/issues/1089), the JET code base uses this convention. We understand that naming conventions are not a robust solution for enforcing privacy. To help mitigate some of the risk, the JET runtime code base is run through the [Closure Compiler](https://developers.google.com/closure/compiler/), which mangles private property names.
25+
26+
The JET team is evaluating other [approaches to private properties](https://curiosity-driven.org/private-properties-in-javascript), and would encourage our clients to do the same.
27+
28+
#### 1.2 Anonymous function expressions are allowed
29+
30+
_ESLint rule change_: [func-names](http://eslint.org/docs/rules/func-names) is disabled.
31+
32+
The Airbnb ESLint rules enforce that all function expressions must be named. This requires duplication when assigning function expressions, e.g.:
33+
34+
```javascript
35+
Foo.prototype.doSomething = function doSomething() { };
36+
```
37+
38+
Given that ES6 specifies new rules for [function name inference](http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation), the JET code base allows anonymous function expressions.
39+
40+
Note that while modern browsers support function name inference, the use of anonymous function expressions can make debugging more challenging on older browsers (e.g. IE11).
41+
42+
#### 1.3 Functions may be used before they are defined (in non-hoisting situations)
43+
44+
_ESLint rule change_: [no-use-before-define](http://eslint.org/docs/rules/no-use-before-define) is disabled for functions.
45+
46+
Robert Martin's [Clean Code](https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882) promotes the notion that code should read like a top-down narrative, where higher level functions appear at the top of the module, followed by functions of increasingly lower levels of abstraction that are used to implement the preceding higher level functions. This approach to code organization is dubbed "The Stepdown Rule".
47+
48+
Unfortunately, the no-use-before-define ESLint rule is not compatible with this approach.
49+
50+
In theory, no-use-before-define intends to protect developers from relying on function hoisting behavior like this:
51+
52+
```javascript
53+
// Call function that has not yet been defined
54+
doSomething();
55+
56+
// Define function somewhere later in the same scope
57+
function doSomething() { }
58+
```
59+
The above code relies on the fact that the definition of the doSomething function will be hoisted to the top of the scope, above the doSomething() call. This is reasonable to flag.
60+
61+
However, the no-use-before-define rule additionally reports the following code as a violation:
62+
63+
```javascript
64+
function doSomething() {
65+
doSomeLowerLevelThing();
66+
}
67+
68+
function doSomeLowerLevelThing() {}
69+
```
70+
71+
Although the above code does not rely on function hoisting, no-use-before-define still considers this code to be invalid, which prohibits the use of Martin's Stepdown Rule.
72+
73+
The JET team likes the Stepdown Rule enough to justify disabling the no-use-before-define rule defined by Airbnb's ESLint config. (We disable the rule just for functions, not for variables.)
74+
75+
If in the future we find (or implement) an ESLint rule that can distinguish between hoisting-dependent vs. hoisting-independent usages, we may start treating hoisting-dependent use-before-define cases as violations. As such, we encourage JET developers to limit reliance on function hoisting, even though this is not currently enforced.
76+
77+
78+
#### 1.4. Function declarations are allowed
79+
80+
_ESLint rule change_: None.
81+
82+
The Airbnb style guide prefers the use of [function expressions instead of function declarations](https://github.com/airbnb/javascript#functions--declarations) due to concerns over function [hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html) confusion.
83+
84+
We have found function declarations to be readable and have increased complexity in our code base. As such, we continue to leverage this language feature.
85+
86+
Note that it appears that Airbnb eventually plans to enforce the use of function expressions via the [func-style](http://eslint.org/docs/rules/func-style) rule. However, this is not yet enforced, so JET does not yet make any rule changes relating to this.
87+
88+
#### 1.5 Platform-specific line breaks are allowed
89+
90+
_ESLint rule change_: [linebreak-style](http://eslint.org/docs/rules/linebreak-style) is disabled.
91+
92+
Rather than enforce a consistent line break style via ESLint, we prefer to deal with this at the source control layer. This allows our developers to do development (including running ESLint) on their platform of choice without having to worry about line breaks.
93+
94+
#### 1.6 The unary increment/decrement operators may be used in for loops
95+
96+
_ESLint rule change_: [no-plusplus](http://eslint.org/docs/rules/no-plusplus) is disabled for afterthoughts in for loops.
97+
98+
The Airbnb style guide raises various [concerns about the use of ++ and --](https://github.com/airbnb/javascript#variables--unary-increment-decrement). While we agree with these concerns, we are comfortable with allowing these operators in for loops.
99+
100+
Note that, like Airbnb, we prefer [higher-order functions instead of loops](https://github.com/airbnb/javascript#iterators--nope).
101+
102+
### 2. ES6-specific Deltas
103+
104+
The following changes are specific to the ES6 version of the Oracle JET ESLint configuration, used by JET's Node-based tooling packages.
105+
106+
#### 2.1 Console logging is allowed
107+
108+
_ESLint rule change_: [no-console](http://eslint.org/docs/rules/no-console) is disabled.
109+
110+
For the moment, our ES6 configuration is exclusively used by JET's Node-based tooling modules. These modules use console logging to communicate with the end user.
111+
112+
Note we are considering generalizing our ES6 rules to apply to browser code as well, in which case we would change to (globally) disallowing console logging.
113+
114+
#### 2.2 Use strict is allowed
115+
116+
_ESLint rule change_: [strict](http://eslint.org/docs/rules/strict) is disabled.
117+
118+
The Airbnb ESLint config forbids the use of 'use strict' as Airbnb relies on [Babel](https://babeljs.io/) to automatically insert this construct as needed. Since JET's build infrastructure does not automatically insert 'use strict', our ESLint config allows developers to do this manually.
119+
120+
#### 2.3 Dangling commas are not required
121+
122+
_ESLint rule change_: [comma-dangle](http://eslint.org/docs/rules/comma-dangle) is disabled.
123+
124+
Airbnb's (ES6) style guide mandates the use of dangling commas for the purpose of having cleaner git diffs. We find that dangling commas can be slightly less readable and slightly more confusing for developers, so we prefer to optimize for reading over diff'ing.
125+
126+
#### 2.4 Unresolved imports are (temporarily) allowed
127+
128+
_ESLint rule change_: [import/no-unresolved](http://eslint.org/docs/rules/import/no-unresolved) is disabled.
129+
130+
While we would like to leave this rule enabled, we are currently seeing some false positives triggered by this rule. As such, we are temporarily disabling this while we get to the bottom of the violations. We plan to re-enable this rule in a future version of our eslint-config-oraclejet.
131+
132+
## [Contributing](https://github.com/oracle/eslint-config-oraclejet/tree/master/CONTRIBUTING.md)
133+
Oracle JET is an open source project. Pull Requests are currently not being accepted. See [CONTRIBUTING](https://github.com/oracle/eslint-config-oraclejet/tree/master/CONTRIBUTING.md) for details.
134+
135+
## [License](https://github.com/oracle/eslint-config-oraclejet/tree/master/LICENSE.md)
136+
Copyright (c) 2014, 2018 Oracle and/or its affiliates The Universal Permissive License (UPL), Version 1.0

RELEASENOTES.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1-
## Release Notes for eslint-config-oraclejet ##
2-
3-
### 5.2.0
4-
* No changes
5-
6-
### 5.1.0
7-
* No changes
8-
9-
### 5.0.0
10-
* quote-props and dot-notation reverted to defaults for ES5
11-
12-
### 4.2.0
13-
* No changes
14-
15-
### 4.1.0
16-
* No changes
17-
18-
### 4.0.0
19-
* Moved module into @oracle scope, changing the name to @oracle/eslint-config-oraclejet
20-
21-
### 3.2.0
22-
* No changes
23-
24-
### 3.1.0
25-
* No changes
26-
27-
### 3.0.0
28-
* Initial version
1+
## Release Notes for eslint-config-oraclejet ##
2+
3+
### 6.0.0
4+
* No changes
5+
6+
### 5.2.0
7+
* No changes
8+
9+
### 5.1.0
10+
* No changes
11+
12+
### 5.0.0
13+
* quote-props and dot-notation reverted to defaults for ES5
14+
15+
### 4.2.0
16+
* No changes
17+
18+
### 4.1.0
19+
* No changes
20+
21+
### 4.0.0
22+
* Moved module into @oracle scope, changing the name to @oracle/eslint-config-oraclejet
23+
24+
### 3.2.0
25+
* No changes
26+
27+
### 3.1.0
28+
* No changes
29+
30+
### 3.0.0
31+
* Initial version

0 commit comments

Comments
 (0)