Skip to content

Commit

Permalink
Get rid of esnext config
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 14, 2021
1 parent eafbd8f commit dd613d3
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 85 deletions.
55 changes: 0 additions & 55 deletions esnext.js

This file was deleted.

48 changes: 48 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,17 @@ module.exports = {
],
'no-unused-labels': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-concat': 'error',
'no-useless-escape': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'no-warning-comments': 'warn',
'no-with': 'error',

// Disabled for now as Firefox doesn't support named capture groups and I'm tired of getting issues about the use of named capture groups...
// 'prefer-named-capture-group': 'error'

'prefer-promise-reject-errors': [
'error',
{
Expand Down Expand Up @@ -410,6 +415,7 @@ module.exports = {
}
],
'prefer-exponentiation-operator': 'error',
'prefer-object-spread': 'error',
'quote-props': [
'error',
'as-needed'
Expand Down Expand Up @@ -525,6 +531,48 @@ module.exports = {
],
'no-useless-constructor': 'error',
'no-useless-rename': 'error',
'no-var': 'error',
'object-shorthand': [
'error',
'always'
],
'prefer-arrow-callback': [
'error',
{
allowNamedFunctions: true
}
],
'prefer-const': [
'error',
{
destructuring: 'all'
}
],
'prefer-destructuring': [
'error',
{
// `array` is disabled because it forces destructuring on
// stupid stuff like `foo.bar = process.argv[2];`
// TODO: Open ESLint issue about this
VariableDeclarator: {
array: false,
object: true
},
AssignmentExpression: {
array: false,

// Disabled because object assignment destructuring requires parens wrapping:
// `let foo; ({foo} = object);`
object: false
}
},
{
enforceForRenamedProperties: false
}
],
'prefer-numeric-literals': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'require-yield': 'error',
'rest-spread-spacing': [
'error',
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
},
"files": [
"index.js",
"esnext.js",
"browser.js"
],
"keywords": [
Expand Down
10 changes: 1 addition & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,7 @@ Or to `.eslintrc`:

Supports parsing ES2015+, but doesn't enforce it by default.

This package also exposes [`xo/esnext`](esnext.js) if you want ES2015+ rules:

```json
{
"extends": "xo/esnext"
}
```

And [`xo/browser`](browser.js) if you're in the browser:
This package also exposes [`xo/browser`](browser.js) if you're in the browser:

```json
{
Expand Down
20 changes: 0 additions & 20 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,6 @@ test('main', t => {
t.true(hasRule(errors, 'quotes'));
});

test('esnext', t => {
const conf = require('../esnext');

t.true(isPlainObj(conf));
t.true(isPlainObj(conf.rules));

const errors = runEslint('var foo = true;\n', conf);
t.true(hasRule(errors, 'no-var'));
});

test('esnext es2016', t => {
const conf = require('../esnext');

t.true(isPlainObj(conf));
t.true(isPlainObj(conf.rules));

const errors = runEslint('let unused; const x = async () => {\n\tawait Promise.resolve({b: 1, ...x});\n};\n', conf);
t.true(hasRule(errors, 'no-unused-vars'));
});

test('browser', t => {
const conf = require('../browser');

Expand Down

0 comments on commit dd613d3

Please sign in to comment.