Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MWPW-134597] Bacom run-lint workflow #139

Merged
merged 5 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
last 1 chrome version
last 1 firefox version
last 1 edge version
safari >= 14
ios_saf >= 14
19 changes: 19 additions & 0 deletions .eslintrc-code-compatibility.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {

Check warning on line 1 in .eslintrc-code-compatibility.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override. Raw Output: {"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}
JasonHowellSlavin marked this conversation as resolved.
Show resolved Hide resolved
root: true,
extends: ['plugin:compat/recommended', 'plugin:ecmalist/recommended'],
settings: { es: { aggressive: true } },
env: { browser: true, mocha: true },
parser: '@babel/eslint-parser',
parserOptions: {
allowImportExportEverywhere: true,
sourceType: 'module',
requireConfigFile: false,
},
plugins: [
"eslint-plugin-import",
],
ignorePatterns: [
'/libs/deps/*',
'/tools/loc/*',
],
};
37 changes: 29 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
root: true,
extends: 'airbnb-base',
extends: ['airbnb-base', 'plugin:react-hooks/recommended', 'plugin:compat/recommended', 'plugin:ecmalist/recommended'],
settings: { es: { aggressive: true } },
env: { browser: true, mocha: true },
parser: '@babel/eslint-parser',
parserOptions: {
Expand All @@ -9,25 +10,45 @@ module.exports = {
requireConfigFile: false,
},
rules: {
// allow reassigning param
'no-param-reassign': [2, { props: false }],
'linebreak-style': ['error', 'unix'],
'chai-friendly/no-unused-expressions': 2,
'import/extensions': ['error', { js: 'always' }],
'import/no-cycle': 0,
'linebreak-style': ['error', 'unix'],
'no-await-in-loop': 0,
'no-param-reassign': [2, { props: false }],
'no-restricted-syntax': [
'error',
{
selector: 'ForInStatement',
message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
},
{
selector: 'LabeledStatement',
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
'no-return-assign': ['error', 'except-parens'],
'no-unused-expressions': 0,
'object-curly-newline': ['error', {
ObjectExpression: { multiline: true, minProperties: 6 },
ObjectPattern: { multiline: true, minProperties: 6 },
ImportDeclaration: { multiline: true, minProperties: 6 },
ExportDeclaration: 'never',
ExportDeclaration: { multiline: true, minProperties: 6 },
}],
'no-unused-expressions': 0,
'chai-friendly/no-unused-expressions': 2,
},
overrides: [
{
files: ['test/**/*.js'],
rules: { 'no-console': 'off' },
rules: { 'no-console': 0 },
},
],
ignorePatterns: [
'/tools/loc/*',
],
plugins: [
'chai-friendly',
],
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/run-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.js'

jobs:
run-lint:
name: Running eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Run eslint on changed files
uses: tj-actions/eslint-changed-files@v20
with:
config_path: ".eslintrc.js"
# ignore_path: "/path/to/.eslintignore"
# extra_args: "--max-warnings=0"
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions blocks/faas-decode/faas-decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default async function init(el) {
const resp = await fetch(url);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <compat/compat> reported by reviewdog 🐶
fetch is not supported in op_mini all


if (!resp?.ok) {
// eslint-disable-next-line no-console
console.log(`Error fetching data from url: ${url}`);
return;
}
Expand Down
Loading
Loading