Skip to content

Commit 625242f

Browse files
Changed the "quotes" rule from single-quotes to double-quotes. Use ESLint's --fix option to automatically make this change
1 parent 2a28572 commit 625242f

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ This module configures ESLint to parse your JavaScript files with [script semant
6969
This module configures ESLint to parse [JSX syntax](https://facebook.github.io/react/docs/jsx-in-depth.html). It also contains JSX-specific rules, such as enforcing the use of [double-quotes in JSX attributes](http://eslint.org/docs/rules/jsx-quotes).
7070

7171
### `modular/style` <small>[(source)](./style.js)</small>
72-
This module contains code-styling and consistency rules, such as [single-quotes](http://eslint.org/docs/rules/quotes), [two-space indentation](http://eslint.org/docs/rules/indent), and [semi-colons](http://eslint.org/docs/rules/semi). Obviously, the rules in this module are entirely subjective and reflect my personal preferences. You are free to override or extend these rules as you desire, or not use this module at all.
72+
This module contains code-styling and consistency rules, such as [double-quotes](http://eslint.org/docs/rules/quotes), [two-space indentation](http://eslint.org/docs/rules/indent), and [semi-colons](http://eslint.org/docs/rules/semi). Obviously, the rules in this module are entirely subjective and reflect my personal preferences. You are free to override or extend these rules as you desire, or not use this module at all.
7373

7474
### `modular/test` <small>[(source)](./test.js)</small>
7575
This module configures ESLint to recognize globals that are defined by common test frameworks, such as `describe`, `it`, `beforeEach`, `assert`, `expect`, etc. It also disables rules that tend to cause problems with certain test frameworks.

style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ module.exports = {
155155
// require single quotes for all strings
156156
quotes: [
157157
'error',
158-
'single',
158+
'double',
159159
'avoid-escape',
160160
],
161161

test/specs/browser.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ chai.should();
66

77
describe('browser', function () {
88
it('should not be enforced if module is not used', function () {
9-
let results = ESLint.run('modular/style', "alert('hello, world');\n");
9+
let results = ESLint.run('modular/style', 'alert("hello, world");\n');
1010
results.errorCount.should.equal(0);
1111
});
1212

@@ -38,4 +38,3 @@ describe('browser', function () {
3838
results.messages[1].message.should.equal("Use the function form of 'use strict'.");
3939
});
4040
});
41-

test/specs/eslint.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('ESLint', function () {
99
// which means that all of our modules are syntactically valid
1010
it('should run without errors', function () {
1111
let results = ESLint.run('modular',
12-
"'use strict';\n" +
12+
'"use strict";\n' +
1313
'var foo = 1;\n' +
1414
'bar(foo);\n' +
1515
'function bar () {\n' +
@@ -22,12 +22,11 @@ describe('ESLint', function () {
2222

2323
// This test just verifies that ESLint correctly loaded our modules
2424
it('should report errors for rule violations', function () {
25-
let results = ESLint.run('modular', 'var foo = "hello, world"');
25+
let results = ESLint.run('modular', "var foo = 'hello, world'");
2626

2727
results.rules.should.deep.equal([
2828
'strict', 'no-unused-vars', 'quotes', 'eol-last', 'semi'
2929
]);
3030
results.errorCount.should.equal(5);
3131
});
3232
});
33-

test/specs/style.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,34 @@ describe('style', function () {
1414

1515
it('should require camel-case variable names', function () {
1616
let results = ESLint.run('modular/style',
17-
"var My_Variable = 'hello, world';\n"
17+
'var My_Variable = "hello, world";\n'
1818
);
1919
results.errorCount.should.equal(1);
2020
results.rules.should.deep.equal(['camelcase']);
2121
});
2222

23-
it('should require single quotes for strings', function () {
23+
it('should require double quotes for strings', function () {
2424
let results = ESLint.run('modular/style',
25-
'var myVariable = "hello, world";\n'
25+
"var myVariable = 'hello, world';\n"
2626
);
2727
results.errorCount.should.equal(1);
2828
results.rules.should.deep.equal(['quotes']);
2929
});
3030

3131
it('should require semi-colons', function () {
3232
let results = ESLint.run('modular/style',
33-
"var myVariable = 'hello, world'\n"
33+
'var myVariable = "hello, world"\n'
3434
);
3535
results.errorCount.should.equal(1);
3636
results.rules.should.deep.equal(['semi']);
3737
});
3838

3939
it('should require a newline at the end of the file', function () {
4040
let results = ESLint.run('modular/style',
41-
"var myVariable = 'hello, world';"
41+
'var myVariable = "hello, world";'
4242
);
4343
results.errorCount.should.equal(1);
4444
results.rules.should.deep.equal(['eol-last']);
4545
});
46-
});
4746

47+
});

0 commit comments

Comments
 (0)