Skip to content

Commit aada137

Browse files
mgolpetebacondarwin
authored andcommitted
chore(eslint): enable quotes: ["error", "single"]
The quotes rule had to be disabled for e2e tests generated from ngdoc because dgeni templates use double quotes as string delimiters. Since we can't have guarantees that dgeni template wrappers will follow the same JS code style the Angular 1 repo uses, we should find a way to enforce our ESLint setup only for the parts in this repo, perhaps via prepending a generated `/* eslint-enable OUR_RULES */` pragma. (partially cherry-picked from 9360aa2) Closes angular#15011
1 parent 353e3a6 commit aada137

File tree

171 files changed

+2098
-2090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+2098
-2090
lines changed

.eslintrc-base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
"no-spaced-func": "error",
105105
"no-trailing-spaces": "error",
106106
"no-unneeded-ternary": "error",
107+
"quotes": ["error", "single"],
107108
"semi-spacing": "error",
108109
"semi": "error",
109110
"space-before-blocks": ["error", "always"],

.eslintrc-todo.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
2121
"object-curly-spacing": ["error", "never"],
2222
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
23-
"operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" }}],
24-
"quotes": ["error", "single"]
23+
"operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" }}]
2524
}
2625
}

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ module.exports = function(grunt) {
205205
dest: 'build/angular-parse-ext.js',
206206
src: util.wrap(files['angularModules']['ngParseExt'], 'module')
207207
},
208-
"promises-aplus-adapter": {
208+
'promises-aplus-adapter': {
209209
dest:'tmp/promises-aplus-adapter++.js',
210210
src:['src/ng/q.js', 'lib/promises-aplus/promises-aplus-test-adapter.js']
211211
}

angularFiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ var angularFiles = {
209209
'build/docs/docs-scenario.js'
210210
],
211211

212-
"karmaModules": [
212+
'karmaModules': [
213213
'build/angular.js',
214214
'@angularSrcModules',
215215
'test/modules/no_bootstrap.js',

benchmarks/ng-options-bp/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"use strict";
1+
'use strict';
22

33
/* globals angular, benchmarkSteps */
44

benchmarks/orderby-bp/bp.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module.exports = function(config) {
66
config.set({
77
scripts: [
88
{
9-
"id": "jquery",
10-
"src": "jquery-noop.js"
9+
'id': 'jquery',
10+
'src': 'jquery-noop.js'
1111
}, {
1212
id: 'angular',
1313
src: '/build/angular.js'

changelog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ var writeChangelog = function(stream, commits, version) {
160160
if (commit.breaking) {
161161
sections.breaks[component] = sections.breaks[component] || [];
162162
sections.breaks[component].push({
163-
subject: util.format("due to %s,\n %s", linkToCommit(commit.hash), commit.breaking),
163+
subject: util.format('due to %s,\n %s', linkToCommit(commit.hash), commit.breaking),
164164
hash: commit.hash,
165165
closes: []
166166
});

docs/app/e2e/api-docs/api-pages.scenario.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

3-
describe("doc.angularjs.org", function() {
3+
describe('doc.angularjs.org', function() {
44

5-
describe("API pages", function() {
5+
describe('API pages', function() {
66

7-
it("should display links to code on GitHub", function() {
7+
it('should display links to code on GitHub', function() {
88
browser.get('build/docs/index.html#!/api/ng/service/$http');
99
expect(element(by.css('.improve-docs')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/edit\/.+\/src\/ng\/http\.js/);
1010

@@ -38,7 +38,7 @@ describe("doc.angularjs.org", function() {
3838
expect(code.getText()).toContain('guest!!!');
3939
});
4040

41-
it("should trim indentation from code blocks", function() {
41+
it('should trim indentation from code blocks', function() {
4242
browser.get('build/docs/index.html#!/api/ng/type/$rootScope.Scope');
4343

4444
var codeBlocks = element.all(by.css('pre > code.lang-js'));

docs/app/e2e/api-docs/provider-pages.scenario.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
describe("provider pages", function() {
3+
describe('provider pages', function() {
44

5-
it("should show the related service", function() {
5+
it('should show the related service', function() {
66
browser.get('build/docs/index.html#!/api/ng/provider/$compileProvider');
77
var serviceLink = element.all(by.css('ol.api-profile-header-structure li a')).first();
88
expect(serviceLink.getText()).toEqual('- $compile');

docs/app/e2e/api-docs/service-pages.scenario.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
describe("service pages", function() {
3+
describe('service pages', function() {
44

5-
it("should show the related provider if there is one", function() {
5+
it('should show the related provider if there is one', function() {
66
browser.get('build/docs/index.html#!/api/ng/service/$compile');
77
var providerLink = element.all(by.css('ol.api-profile-header-structure li a')).first();
88
expect(providerLink.getText()).toEqual('- $compileProvider');
@@ -14,7 +14,7 @@ describe("service pages", function() {
1414
expect(providerLink.getAttribute('href')).not.toMatch(/api\/ng\/provider\/\$compileProvider/);
1515
});
1616

17-
it("should show parameter defaults", function() {
17+
it('should show parameter defaults', function() {
1818
browser.get('build/docs/index.html#!/api/ng/service/$timeout');
1919
expect(element.all(by.css('.input-arguments p em')).first().getText()).toContain('(default: 0)');
2020
});

0 commit comments

Comments
 (0)