Add initial eslint script
This commit is contained in:
parent
ad3376b9dc
commit
4db4d409a7
2 changed files with 25 additions and 0 deletions
25
script/eslint.py
Executable file
25
script/eslint.py
Executable file
|
@ -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())
|
Loading…
Add table
Add a link
Reference in a new issue