Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
👕 Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcanemagus committed Sep 5, 2017
1 parent d9c5b5f commit 833cfbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function loadDeps() {
helpers = require('./helpers');
}
if (!dirname) {
dirname = require('path').dirname;
({ dirname } = require('path'));
}
if (!stylelint) {
stylelint = require('stylelint');
Expand Down
10 changes: 5 additions & 5 deletions spec/linter-stylelint-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const blockNoEmpty = 'Unexpected empty block (block-no-empty)';
const blockNoEmptyUrl = 'http://stylelint.io/user-guide/rules/block-no-empty';

describe('The stylelint provider for Linter', () => {
const lint = require('../lib/index.js').provideLinter().lint;
const { lint } = require('../lib/index.js').provideLinter();

beforeEach(async () => {
atom.workspace.destroyActivePaneItem();
Expand Down Expand Up @@ -85,13 +85,13 @@ describe('The stylelint provider for Linter', () => {
const invalidExtendsPath = path.join(fixtures, 'invalid-extends', 'styles.css');

spyOn(atom.notifications, 'addError').andCallFake(() => ({}));
const addError = atom.notifications.addError;
const { addError } = atom.notifications;

const editor = await atom.workspace.open(invalidExtendsPath);
const messages = await lint(editor);
expect(messages.length).toBe(0);

const args = addError.mostRecentCall.args;
const { args } = addError.mostRecentCall;
expect(addError.calls.length).toBe(1);
expect(args[0]).toBe('Unable to parse stylelint configuration');
expect(args[1].detail).toContain('Could not find "some-module-that-will-never-exist".');
Expand All @@ -102,13 +102,13 @@ describe('The stylelint provider for Linter', () => {
const invalidConfigPath = path.join(fixtures, 'invalid-config', 'styles.css');

spyOn(atom.notifications, 'addError').andCallFake(() => ({}));
const addError = atom.notifications.addError;
const { addError } = atom.notifications;

const editor = await atom.workspace.open(invalidConfigPath);
const messages = await lint(editor);
expect(messages.length).toBe(0);

const args = addError.mostRecentCall.args;
const { args } = addError.mostRecentCall;
expect(addError.calls.length).toBe(1);
expect(args[0]).toBe('Unable to parse stylelint configuration');
expect(args[1].detail).toContain('>>>');
Expand Down

0 comments on commit 833cfbe

Please sign in to comment.