From 4db4d409a7b24375361558aeaa4f3d0d97900180 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 15 Jan 2016 13:52:18 -0800 Subject: [PATCH] Add initial eslint script --- script/eslint.py | 25 ++++++++++++++++++++++ .eslintrc.json => script/eslintrc-src.json | 0 2 files changed, 25 insertions(+) create mode 100755 script/eslint.py rename .eslintrc.json => script/eslintrc-src.json (100%) diff --git a/script/eslint.py b/script/eslint.py new file mode 100755 index 000000000000..cbf1b0b24703 --- /dev/null +++ b/script/eslint.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +import glob +import os +import sys + +from lib.util import execute + + +SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) + + +def main(): + os.chdir(SOURCE_ROOT) + + eslint = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'eslint') + if sys.platform in ['win32', 'cygwin']: + eslint += '.cmd' + settings = ['--quiet', '--config', os.path.join('script', 'eslintrc.json')] + + execute([eslint] + settings + ['atom']) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/.eslintrc.json b/script/eslintrc-src.json similarity index 100% rename from .eslintrc.json rename to script/eslintrc-src.json