$> git clone https://github.com/gasru/google-apps-script-eslint-env.git
$> npm i
$> npm run run-fix
< [email protected] run-fix /raid/user/gasru/google-apps-script-eslint-env
< npm run demo && npm run lint-fix && exit 0
< [email protected] demo /raid/user/gasru/google-apps-script-eslint-env
< rm src/*.* && cp demo/*.js src/
< [email protected] lint-fix /raid/user/gasru/google-apps-script-eslint-env
< eslint --fix src/
/raid/user/gasru/google-apps-script-eslint-env/src/Code.js
8:10 error 'tryToMakeDocFile' is defined but never used no-unused-vars
20:12 error Unexpected constant condition no-constant-condition
21:13 error 'par' is assigned a value but never used no-unused-vars
✖ 3 problems (3 errors, 0 warnings)
$> npm i -D @types/google-apps-script eslint eslint-config-google eslint-config-prettier eslint-plugin-googleappsscript eslint-plugin-prettier prettier
$> curl https://raw.githubusercontent.com/gasru/google-apps-script-eslint-env/master/.eslintrc.json --output .eslintrc.json
$> curl https://raw.githubusercontent.com/gasru/google-apps-script-eslint-env/master/.prettierrc --output .prettierrc
После внесения изменений в файл src/Code.js
можно запустить перепроверку
$> npm run re-run-fix
Следующие условия необходимы:
- Node.js
- TSServer engine. Входит в состав TypeScript SDK
npm install -g typescript