From b36710a76e9a378ca7d54a4d68c2e0a4024dad36 Mon Sep 17 00:00:00 2001 From: Samuel FORESTIER Date: Thu, 5 Nov 2020 16:00:40 +0100 Subject: [PATCH] Replaces Acorn over Travis CI by ESLint over (Microsoft) GitHub Actions > See #11, Acorn was great but not sufficient for Mozilla's libPref syntax... --- .eslintrc.yml | 45 +++++++++++++++++++++++++++++++++++ .github/workflows/linting.yml | 17 +++++++++++++ .travis.yml | 8 ------- 3 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 .eslintrc.yml create mode 100644 .github/workflows/linting.yml delete mode 100644 .travis.yml diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..b170078 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,45 @@ +%YAML 1.2 +--- + +root: true + +extends: 'eslint:recommended' + +globals: + # From + pref: true + user_pref: true + sticky: true + locked: true + sticky_pref: true + +rules: + # Expect a semicolon after each statement. + semi: + - "error" + - "always" + - + omitLastInOneLineBlock: false + + # As internal code style, don't allow tabulation. + no-tabs: "error" + # ... nor trailing spaces ! + no-trailing-spaces: "error" + + # Expect only double-quoted strings. + quotes: + - "error" + - "double" + + # Don't allow whitespace before semicolons. + semi-spacing: + - "error" + - + before: false + + # Don't allow irregular whitespace characters in our sheet. + no-irregular-whitespace: + - "error" + - + skipStrings: false + skipComments: false diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..851acec --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,17 @@ +--- +name: Linting + +on: [push, pull_request] + +jobs: + build: + name: Run ESLint on user.js + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + + - run: npm install -g eslint + - run: eslint user.js diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b9fc006..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - 'node' - -before_script: - - npm install -g acorn -script: - - acorn --silent user.js