mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
dae1dc6292
Eslint now allows us to use a different parser, which allows us to use esprima-fb explicitly. This means we don't have to wait for espree to add things like rest-param parsing. Though we do need eslint to upgrade its rules to handle that AST. I had hoped to enable parsing of our tests but we can't do that until we change esprima-fb's XJS nodes to JSX. While I was here, I also enabled the no-unused-vars rule since eslint understands template strings. I also made the single quote enforcement actually fail instead of just warn.
27 lines
745 B
JavaScript
27 lines
745 B
JavaScript
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule quoteAttributeValueForBrowser
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var escapeTextContentForBrowser = require('escapeTextContentForBrowser');
|
|
|
|
/**
|
|
* Escapes attribute value to prevent scripting attacks.
|
|
*
|
|
* @param {*} value Value to escape.
|
|
* @return {string} An escaped string.
|
|
*/
|
|
function quoteAttributeValueForBrowser(value) {
|
|
return '"' + escapeTextContentForBrowser(value) + '"';
|
|
}
|
|
|
|
module.exports = quoteAttributeValueForBrowser;
|