Skip to content

Commit

Permalink
Revert unrelated formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Jan 2, 2025
1 parent 1be0a3c commit f1718db
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
"use strict";

const js = require('@eslint/js');
const n = require('eslint-plugin-n');
Expand Down Expand Up @@ -53,7 +53,7 @@ module.exports = [
],
languageOptions: {
globals: globals.node,
ecmaVersion: 2020
ecmaVersion: 2020,
}
},
{
Expand Down Expand Up @@ -81,8 +81,8 @@ module.exports = [
{
files: ['test/**/*.mjs'],
languageOptions: {
sourceType: 'module'
}
sourceType: "module"
},
},
{
files: ['bin/*', 'lib/**/*.js'],
Expand Down Expand Up @@ -119,39 +119,33 @@ module.exports = [
}
],
'no-restricted-modules': ['error', 'timers'],
'no-restricted-syntax': [
'error',
"no-restricted-syntax": ['error',
// disallow `global.setTimeout()`, `global.setInterval()`, etc.
{
message: messages.gh237,
selector:
'CallExpression[callee.object.name=global][callee.property.name=/(set|clear)(Timeout|Immediate|Interval)/]'
selector: 'CallExpression[callee.object.name=global][callee.property.name=/(set|clear)(Timeout|Immediate|Interval)/]'
},
// disallow `new global.Date()`
{
message: messages.gh237,
selector:
'NewExpression[callee.object.name=global][callee.property.name=Date]'
selector: 'NewExpression[callee.object.name=global][callee.property.name=Date]'
},
// disallow property access of `global.<timer>.*`
{
message: messages.gh237,
selector:
'*[object.object.name=global][object.property.name=/(Date|(set|clear)(Timeout|Immediate|Interval))/]:expression'
selector: '*[object.object.name=global][object.property.name=/(Date|(set|clear)(Timeout|Immediate|Interval))/]:expression'
}
]
}
},
{
files: ['lib/reporters/*.js'],
rules: {
'no-restricted-syntax': [
'error',
'no-restricted-syntax': ['error',
// disallow Reporters using `console.log()`
{
message: messages.gh3604,
selector:
'CallExpression[callee.object.name=console][callee.property.name=log]'
selector: 'CallExpression[callee.object.name=console][callee.property.name=log]'
}
]
}
Expand All @@ -165,6 +159,6 @@ module.exports = [
'test/integration/fixtures/**',
'.karma/**',
'mocha.js'
]
],
}
];

0 comments on commit f1718db

Please sign in to comment.