Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup recommended eslint preset #1345

Merged
merged 1 commit into from Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 0 additions & 19 deletions .editorconfig

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/main.yml
Expand Up @@ -26,3 +26,4 @@ jobs:
- run: npm ci
- run: npm test
- run: npm run test-browser
- run: npm run lint
3 changes: 0 additions & 3 deletions .jshintignore

This file was deleted.

30 changes: 0 additions & 30 deletions .jshintrc

This file was deleted.

2 changes: 1 addition & 1 deletion examples/test.js
Expand Up @@ -49,7 +49,7 @@ FS.readFile(filepath, 'utf8', function(err, data) {
throw err;
}

const result = svgo.optimize(data, {path: filepath, ...config});
const result = optimize(data, {path: filepath, ...config});

console.log(result);

Expand Down
1 change: 1 addition & 0 deletions lib/svgo-node.js
Expand Up @@ -39,6 +39,7 @@ const loadConfig = async (configFile, cwd = process.cwd()) => {
}
}
let dir = cwd;
// eslint-disable-next-line no-constant-condition
while (true) {
const file = path.join(dir, "svgo.config.js");
if (await isFile(file)) {
Expand Down
7 changes: 4 additions & 3 deletions lib/svgo/coa.js
@@ -1,4 +1,3 @@
/* jshint quotmark: false */
'use strict';

const FS = require('fs');
Expand Down Expand Up @@ -46,7 +45,7 @@ module.exports = function makeProgram(program) {
.action(action);
}

async function action(args, opts) {
async function action(args, opts, command) {
var input = opts.input || args;
var output = opts.output;
var config = {}
Expand Down Expand Up @@ -91,7 +90,9 @@ async function action(args, opts) {
!opts.stdin &&
!opts.folder &&
process.stdin.isTTY === true
) return program.help();
) {
return command.help();
}

if (typeof process == 'object' && process.versions && process.versions.node && PKG && PKG.engines.node) {
var nodeVersion = String(PKG.engines.node).match(/\d*(\.\d+)*/)[0];
Expand Down
1 change: 0 additions & 1 deletion lib/svgo/jsAPI.js
Expand Up @@ -225,7 +225,6 @@ JSAPI.prototype.renameElem = function(name) {
* @return {Object|Undefined}
*/
JSAPI.prototype.computedAttr = function(name, val) {
/* jshint eqnull: true */
if (!arguments.length) return;

for (var elem = this; elem && (!elem.hasAttr(name) || !elem.attr(name).value); elem = elem.parentNode);
Expand Down
2 changes: 1 addition & 1 deletion lib/svgo/svg2js.js
Expand Up @@ -4,7 +4,7 @@ var SAX = require('sax'),
JSAPI = require('./jsAPI.js'),
CSSClassList = require('./css-class-list'),
CSSStyleDeclaration = require('./css-style-declaration'),
entityDeclaration = /<!ENTITY\s+(\S+)\s+(?:'([^\']+)'|"([^\"]+)")\s*>/g;
entityDeclaration = /<!ENTITY\s+(\S+)\s+(?:'([^']+)'|"([^"]+)")\s*>/g;

var config = {
strict: true,
Expand Down