Bug 1270926 - Support ESLint on XHTML files. r=ahal,mratcliffe
MozReview-Commit-ID: 4iYODbZQiB9
--- a/taskcluster/ci/legacy/tasks/tests/eslint-gecko.yml
+++ b/taskcluster/ci/legacy/tasks/tests/eslint-gecko.yml
@@ -27,17 +27,17 @@ task:
- -cx
- >
cd /home/worker/checkouts/gecko/tools/lint/eslint &&
/build/tooltool.py fetch -m manifest.tt &&
tar xvfz eslint.tar.gz &&
rm eslint.tar.gz &&
ln -s ../eslint-plugin-mozilla node_modules &&
cd ../../.. &&
- tools/lint/eslint/node_modules/.bin/eslint --quiet --plugin html --ext [.js,.jsm,.jsx,.xml,.html] -f tools/lint/eslint-formatter .
+ tools/lint/eslint/node_modules/.bin/eslint --quiet --plugin html --ext [.js,.jsm,.jsx,.xml,.html,.xhtml] -f tools/lint/eslint-formatter .
extra:
locations:
build: null
tests: null
treeherder:
machine:
platform: lint
--- a/tools/lint/eslint/npm-shrinkwrap.json
+++ b/tools/lint/eslint/npm-shrinkwrap.json
@@ -218,19 +218,19 @@
"espree": {
"version": "3.1.4",
"from": "espree@3.1.4",
"resolved": "https://registry.npmjs.org/espree/-/espree-3.1.4.tgz"
}
}
},
"eslint-plugin-html": {
- "version": "1.4.0",
- "from": "eslint-plugin-html@1.4.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-1.4.0.tgz"
+ "version": "1.5.2",
+ "from": "eslint-plugin-html@1.5.2",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-1.5.2.tgz"
},
"eslint-plugin-react": {
"version": "4.2.3",
"from": "eslint-plugin-react@4.2.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-4.2.3.tgz"
},
"espree": {
"version": "2.2.5",
--- a/tools/lint/eslint/package.json
+++ b/tools/lint/eslint/package.json
@@ -1,15 +1,15 @@
{
"name": "mach-eslint",
"description": "ESLint and external plugins for use with mach",
"repository": {},
"license": "MPL-2.0",
"dependencies": {
"eslint": "2.9.0",
- "eslint-plugin-html": "1.4.0",
+ "eslint-plugin-html": "1.5.2",
"eslint-plugin-react": "4.2.3",
"escope": "^3.2.0",
"espree": "^2.2.4",
"estraverse": "^4.1.1",
"sax": "^1.1.4"
}
}
--- a/tools/lint/mach_commands.py
+++ b/tools/lint/mach_commands.py
@@ -77,18 +77,18 @@ class MachCommands(MachCommandBase):
lintargs['exclude'] = ['obj*']
cli.SEARCH_PATHS.append(here)
return cli.run(*runargs, **lintargs)
@Command('eslint', category='devenv',
description='Run eslint or help configure eslint for optimal development.')
@CommandArgument('-s', '--setup', default=False, action='store_true',
help='Configure eslint for optimal development.')
- @CommandArgument('-e', '--ext', default='[.js,.jsm,.jsx,.xml,.html]',
- help='Filename extensions to lint, default: "[.js,.jsm,.jsx,.xml,.html]".')
+ @CommandArgument('-e', '--ext', default='[.js,.jsm,.jsx,.xml,.html,.xhtml]',
+ help='Filename extensions to lint, default: "[.js,.jsm,.jsx,.xml,.html,.xhtml]".')
@CommandArgument('-b', '--binary', default=None,
help='Path to eslint binary.')
@CommandArgument('--fix', default=False, action='store_true',
help='Request that eslint automatically fix errors, where possible.')
@CommandArgument('args', nargs=argparse.REMAINDER) # Passed through to eslint.
def eslint(self, setup, ext=None, binary=None, fix=False, args=None):
'''Run eslint.'''