Skip to content

Commit

Permalink
Merge pull request #3044 from LiteFarmOrg/LF-3085_2/Add_a_linter_for_…
Browse files Browse the repository at this point in the history
…translations_files

LF-3085 update Lint Translation Files github workflow for /api
  • Loading branch information
Duncan-Brain authored Dec 20, 2023
2 parents fbeb846 + 8318d80 commit 85bfd92
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 913 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/lint_translation_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
- integration

jobs:
run-linters:
name: Run linters
run-linters-in-webapp:
name: Run linters in webapp
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -29,3 +29,25 @@ jobs:

- name: Run linters
run: npx eslint './public/locales/**/*.json'

run-linters-in-api:
name: Run linters in api
runs-on: ubuntu-20.04
defaults:
run:
working-directory: packages/api/

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies for Node.js server
run: npm install

- name: Run linters
run: npx eslint './src/jobs/locales/**/*.json' './src/templates/locales/**/*.json'
10 changes: 4 additions & 6 deletions packages/api/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: ['eslint:recommended', 'prettier'],
module.exports = {
extends: ['eslint:recommended', 'prettier', 'plugin:json/recommended'],
env: {
es6: true,
node: true,
Expand All @@ -8,10 +8,8 @@ module.exports = {
parserOptions: {
ecmaVersion: 2019,
babelOptions: {
plugins: [
'@babel/plugin-syntax-import-assertions'
]
}
plugins: ['@babel/plugin-syntax-import-assertions'],
},
},
parser: '@babel/eslint-parser',
rules: {
Expand Down
Loading

0 comments on commit 85bfd92

Please sign in to comment.