Skip to content

Commit 22f157c

Browse files
committed
Fix Linting: Override with ESLint
1 parent f15fd0a commit 22f157c

File tree

10 files changed

+395
-352
lines changed

10 files changed

+395
-352
lines changed

.eslintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"no-shadow": "error",
3535
"no-shadow-restricted-names": "error",
3636
"no-spaced-func": "error",
37-
"no-undef-init": "error",
3837
"no-unused-expressions": "error",
3938
"no-with": "error",
4039
"camelcase": "error",
@@ -65,7 +64,6 @@
6564
"space-before-blocks": ["error", "always"],
6665
"prefer-const": "error",
6766
"no-path-concat": "error",
68-
"no-undefined": "error",
6967
"strict": "off",
7068
"curly": ["error", "multi-or-nest"],
7169
"dot-notation": "off",
@@ -88,5 +86,8 @@
8886
"env": {
8987
"node": true,
9088
"es6": true
89+
},
90+
"globals": {
91+
"fixture": true
9192
}
9293
}

Gulpfile.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
var gulp = require("gulp");
2-
var babel = require("gulp-babel");
3-
var mocha = require("gulp-mocha");
4-
var del = require("del");
1+
const gulp = require('gulp');
2+
const babel = require('gulp-babel');
3+
const mocha = require('gulp-mocha');
4+
const del = require('del');
55

6-
gulp.task("clean", function () {
7-
return del("lib");
6+
gulp.task('clean', function () {
7+
return del('lib');
88
});
99

10-
gulp.task("lint", function () {
11-
var eslint = require("gulp-eslint");
10+
gulp.task('lint', function () {
11+
const eslint = require('gulp-eslint');
1212

1313
return gulp
14-
.src(["src/**/*.js", "test/**/*.js", "Gulpfile.js"])
14+
.src(['src/**/*.js', 'test/**/*.js', 'Gulpfile.js'])
1515
.pipe(eslint())
1616
.pipe(eslint.format())
1717
.pipe(eslint.failAfterError());
1818
});
1919

2020
gulp.task(
21-
"build",
22-
gulp.series("clean", "lint", function () {
23-
return gulp.src("src/**/*.js").pipe(babel()).pipe(gulp.dest("lib"));
21+
'build',
22+
gulp.series('clean', 'lint', function () {
23+
return gulp.src('src/**/*.js').pipe(babel()).pipe(gulp.dest('lib'));
2424
}),
2525
);
2626

2727
gulp.task(
28-
"test",
29-
gulp.series("build", function () {
30-
return gulp.src("test/**.js").pipe(
28+
'test',
29+
gulp.series('build', function () {
30+
return gulp.src('test/**.js').pipe(
3131
mocha({
32-
ui: "bdd",
33-
reporter: "spec",
34-
timeout: typeof v8debug === "undefined" ? 2000 : Infinity, // NOTE: disable timeouts in debug
32+
ui: 'bdd',
33+
reporter: 'spec',
34+
timeout: typeof v8debug === 'undefined' ? 2000 : Infinity, // NOTE: disable timeouts in debug
3535
}),
3636
);
3737
}),

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: [["@babel/preset-env", { targets: { node: "current" } }]],
2+
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
33
};

eslint.config.mjs

Lines changed: 98 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,169 +1,169 @@
1-
import globals from "globals";
2-
import babelParser from "@babel/eslint-parser";
3-
import path from "node:path";
4-
import { fileURLToPath } from "node:url";
5-
import js from "@eslint/js";
6-
import { FlatCompat } from "@eslint/eslintrc";
1+
import globals from 'globals';
2+
import babelParser from '@babel/eslint-parser';
3+
import path from 'node:path';
4+
import { fileURLToPath } from 'node:url';
5+
import js from '@eslint/js';
6+
import { FlatCompat } from '@eslint/eslintrc';
77

88
const __filename = fileURLToPath(import.meta.url);
99
const __dirname = path.dirname(__filename);
1010
const compat = new FlatCompat({
11-
baseDirectory: __dirname,
11+
baseDirectory: __dirname,
1212
recommendedConfig: js.configs.recommended,
13-
allConfig: js.configs.all,
13+
allConfig: js.configs.all,
1414
});
1515

1616
export default [
17-
...compat.extends("eslint:recommended"),
17+
...compat.extends('eslint:recommended'),
1818
{
1919
languageOptions: {
2020
globals: {
2121
...globals.node,
2222
},
23-
parser: babelParser,
23+
parser: babelParser,
2424
parserOptions: {
2525
requireConfigFile: false,
26-
babelOptions: {
27-
babelrc: false,
26+
babelOptions: {
27+
babelrc: false,
2828
configFile: false,
2929
},
3030
},
3131
},
3232
rules: {
33-
"no-alert": "error",
34-
"no-array-constructor": "error",
35-
"no-caller": "error",
36-
"no-catch-shadow": "error",
37-
"no-eval": "error",
38-
"no-extend-native": "error",
39-
"no-extra-bind": "error",
40-
"no-implied-eval": "error",
41-
"no-iterator": "error",
42-
"no-label-var": "error",
43-
"no-labels": "error",
44-
"no-lone-blocks": "error",
45-
"no-loop-func": "error",
46-
"no-multi-str": "error",
47-
"no-native-reassign": "error",
48-
"no-new": "error",
49-
"no-new-func": "error",
50-
"no-new-object": "error",
51-
"no-new-wrappers": "error",
52-
"no-octal-escape": "error",
53-
"no-proto": "error",
54-
"no-return-assign": "error",
55-
"no-script-url": "error",
56-
"no-sequences": "error",
57-
"no-shadow": "error",
58-
"no-shadow-restricted-names": "error",
59-
"no-spaced-func": "error",
60-
"no-undef-init": "error",
61-
"no-unused-expressions": "error",
62-
"no-with": "error",
63-
camelcase: "error",
64-
"comma-spacing": "error",
65-
"consistent-return": "error",
66-
eqeqeq: "error",
67-
semi: "error",
68-
69-
"semi-spacing": [
70-
"error",
33+
'no-alert': 'error',
34+
'no-array-constructor': 'error',
35+
'no-caller': 'error',
36+
'no-catch-shadow': 'error',
37+
'no-eval': 'error',
38+
'no-extend-native': 'error',
39+
'no-extra-bind': 'error',
40+
'no-implied-eval': 'error',
41+
'no-iterator': 'error',
42+
'no-label-var': 'error',
43+
'no-labels': 'error',
44+
'no-lone-blocks': 'error',
45+
'no-loop-func': 'error',
46+
'no-multi-str': 'error',
47+
'no-native-reassign': 'error',
48+
'no-new': 'error',
49+
'no-new-func': 'error',
50+
'no-new-object': 'error',
51+
'no-new-wrappers': 'error',
52+
'no-octal-escape': 'error',
53+
'no-proto': 'error',
54+
'no-return-assign': 'error',
55+
'no-script-url': 'error',
56+
'no-sequences': 'error',
57+
'no-shadow': 'error',
58+
'no-shadow-restricted-names': 'error',
59+
'no-spaced-func': 'error',
60+
'no-undef-init': 'error',
61+
'no-unused-expressions': 'error',
62+
'no-with': 'error',
63+
camelcase: 'error',
64+
'comma-spacing': 'error',
65+
'consistent-return': 'error',
66+
eqeqeq: 'error',
67+
semi: 'error',
68+
69+
'semi-spacing': [
70+
'error',
7171
{
7272
before: false,
73-
after: true,
73+
after: true,
7474
},
7575
],
7676

77-
"space-infix-ops": "error",
77+
'space-infix-ops': 'error',
7878

79-
"space-unary-ops": [
80-
"error",
79+
'space-unary-ops': [
80+
'error',
8181
{
82-
words: true,
82+
words: true,
8383
nonwords: false,
8484
},
8585
],
8686

87-
yoda: ["error", "never"],
87+
yoda: ['error', 'never'],
8888

89-
"brace-style": [
90-
"error",
91-
"stroustrup",
89+
'brace-style': [
90+
'error',
91+
'stroustrup',
9292
{
9393
allowSingleLine: false,
9494
},
9595
],
9696

97-
"eol-last": "error",
97+
'eol-last': 'error',
9898

9999
indent: [
100-
"error",
100+
'error',
101101
4,
102102
{
103103
SwitchCase: 1,
104104
},
105105
],
106106

107-
"key-spacing": [
108-
"error",
107+
'key-spacing': [
108+
'error',
109109
{
110-
align: "value",
110+
align: 'value',
111111
},
112112
],
113113

114-
"max-nested-callbacks": ["error", 5],
115-
"new-parens": "error",
116-
"newline-after-var": ["error", "always"],
117-
"no-lonely-if": "error",
114+
'max-nested-callbacks': ['error', 5],
115+
'new-parens': 'error',
116+
'newline-after-var': ['error', 'always'],
117+
'no-lonely-if': 'error',
118118

119-
"no-multiple-empty-lines": [
120-
"error",
119+
'no-multiple-empty-lines': [
120+
'error',
121121
{
122122
max: 2,
123123
},
124124
],
125125

126-
"no-nested-ternary": "error",
127-
"no-underscore-dangle": "off",
128-
"no-unneeded-ternary": "error",
129-
"object-curly-spacing": ["error", "always"],
130-
"operator-assignment": ["error", "always"],
131-
quotes: ["error", "single", "avoid-escape"],
132-
"keyword-spacing": "error",
133-
"space-before-blocks": ["error", "always"],
134-
"prefer-const": "error",
135-
"no-path-concat": "error",
136-
"no-undefined": "error",
137-
strict: "off",
138-
curly: ["error", "multi-or-nest"],
139-
"dot-notation": "off",
140-
"no-else-return": "error",
141-
"one-var": ["error", "never"],
142-
143-
"no-multi-spaces": [
144-
"error",
126+
'no-nested-ternary': 'error',
127+
'no-underscore-dangle': 'off',
128+
'no-unneeded-ternary': 'error',
129+
'object-curly-spacing': ['error', 'always'],
130+
'operator-assignment': ['error', 'always'],
131+
quotes: ['error', 'single', 'avoid-escape'],
132+
'keyword-spacing': 'error',
133+
'space-before-blocks': ['error', 'always'],
134+
'prefer-const': 'error',
135+
'no-path-concat': 'error',
136+
'no-undefined': 'error',
137+
strict: 'off',
138+
curly: ['error', 'multi-or-nest'],
139+
'dot-notation': 'off',
140+
'no-else-return': 'error',
141+
'one-var': ['error', 'never'],
142+
143+
'no-multi-spaces': [
144+
'error',
145145
{
146146
exceptions: {
147-
VariableDeclarator: true,
147+
VariableDeclarator: true,
148148
AssignmentExpression: true,
149149
},
150150
},
151151
],
152152

153-
radix: "error",
154-
"no-extra-parens": "error",
153+
radix: 'error',
154+
'no-extra-parens': 'error',
155155

156-
"new-cap": [
157-
"error",
156+
'new-cap': [
157+
'error',
158158
{
159159
capIsNew: false,
160160
},
161161
],
162162

163-
"space-before-function-paren": ["error", "always"],
164-
"no-use-before-define": ["error", "nofunc"],
165-
"handle-callback-err": "off",
166-
"require-atomic-updates": "off",
163+
'space-before-function-paren': ['error', 'always'],
164+
'no-use-before-define': ['error', 'nofunc'],
165+
'handle-callback-err': 'off',
166+
'require-atomic-updates': 'off',
167167
},
168168
},
169169
];

0 commit comments

Comments
 (0)