Skip to content

Commit

Permalink
feat: migrate to ES2018 syntax and drop obsolete configs
Browse files Browse the repository at this point in the history
BREAKING CHANGES:

* ES2018 is the default syntax for `recommended`. If your source code uses newer syntax version,
  make sure to set `parserOptions#ecmaVersion` accordingly.
* `es5` and `es6` configs are removed. Use `node` or `browser` instead, depending on your environment.
  • Loading branch information
barmac authored and fake-join[bot] committed Sep 13, 2022
1 parent 9b4aedc commit 931d0db
Show file tree
Hide file tree
Showing 19 changed files with 139 additions and 1,122 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ All notable changes to [eslint-plugin-bpmn-io](https://github.com/bpmn-io/eslint

___Note:__ Yet to be released changes appear here._

## 0.15.0

* `FEAT`: use ES2018 syntax in `recommended` config
* `FEAT`: drop `env#node` from `recommended` config
* `FEAT`: drop `es5` and `es6` configs
* `FEAT`: add `node` and `browser` configs
* `DEPS`: drop `@babel/eslint-parser` and related deps
* `DEPS`: drop `eslint@7` support

### Breaking changes

* ES2018 is the default syntax for `recommended`. If your source code uses newer syntax version, make sure to set `parserOptions#ecmaVersion` accordingly.
* `es5` and `es6` configs are removed. Use `node` or `browser` instead, depending on your environment.
* `eslint@7` is no longer supported. Upgrade to `eslint@8` to use the plugin.

## 0.14.1

* `FIX`: do not read local `.babelrc` file
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Extend `bpmn-io/*` in your base eslint configuration:

```json
{
"extends": "plugin:bpmn-io/es6"
"extends": "plugin:bpmn-io/browser"
}
```

Expand All @@ -28,9 +28,9 @@ If you use [mocha](https://mochajs.org/) for testing, place another `.eslintrc`

We ship with a few blue prints:

* `bpmn-io/es5`: Use for ES5 style projects / node libraries
* `bpmn-io/es6`: Use for modern, ES2015 based projects
* `bpmn-io/jsx`: Use `jsx` in conjunction with `es6`
* `bpmn-io/browser`: Use for browser based projects
* `bpmn-io/jsx`: Use `jsx` in conjunction with `browser`
* `bpmn-io/node`: Use for node based projects
* `bpmn-io/mocha`: Use for libraries tested with `mocha` + `chai`


Expand Down
5 changes: 4 additions & 1 deletion configs/es5.js → configs/browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
env: {
browser: true
},
parserOptions: {
ecmaVersion: 5
sourceType: 'module'
},
extends: [
'plugin:bpmn-io/recommended'
Expand Down
17 changes: 0 additions & 17 deletions configs/es6.js

This file was deleted.

5 changes: 2 additions & 3 deletions configs/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ module.exports = {
'react/jsx-uses-vars': 2
},
parserOptions: {
babelOptions: {
plugins: [ '@babel/plugin-syntax-jsx' ],
babelrc: false
ecmaFeatures: {
jsx: true
}
}
};
11 changes: 11 additions & 0 deletions configs/node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
env: {
node: true
},
extends: [
'plugin:bpmn-io/recommended'
],
parserOptions: {
ecmaVersion: 'latest'
}
};
4 changes: 2 additions & 2 deletions configs/recommended.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
env: {
node: true
es2018: true
},
parserOptions: {
ecmaVersion: 5
ecmaVersion: 2018
},
extends: [
'eslint:recommended'
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var es6 = require('./configs/es6');
var es5 = require('./configs/es5');
var browser = require('./configs/browser');
var node = require('./configs/node');
var mocha = require('./configs/mocha');
var jsx = require('./configs/jsx');

Expand All @@ -10,8 +10,8 @@ var recommended = require('./configs/recommended');

module.exports = {
configs: {
es6,
es5,
browser,
node,
mocha,
jsx,
recommended
Expand Down
Loading

0 comments on commit 931d0db

Please sign in to comment.