Skip to content

Commit 66676b8

Browse files
authored
Merge pull request #181 from DavyJonesLocker/chore/neostandard
Migrate to neostandard
2 parents 90cc5a0 + c4c1a0d commit 66676b8

File tree

6 files changed

+53
-6
lines changed

6 files changed

+53
-6
lines changed

.github/workflows/eslint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: ESLint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
eslint:
14+
name: ESLint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: pnpm/action-setup@v4
19+
- name: Set up Node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
- name: Install node dependencies
24+
run: pnpm install
25+
- name: Run JavaScript linter
26+
run: pnpm eslint

.github/workflows/rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
ruby-version: ${{ matrix.ruby-version }}
3030
bundler-cache: true
3131
- name: Ruby linter
32-
run: bundle exec rubocop
32+
run: bundle exec rubocop -f github

Rakefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ task default: [:rubocop, 'test:ruby']
1111
require 'rake/testtask'
1212
namespace :test do
1313
desc %(Run all tests)
14-
task all: [:rubocop, 'test:ruby', 'test:js']
14+
task all: [:rubocop, :lint_javascript, 'test:ruby', 'test:js']
1515

1616
desc %(Test Ruby code)
1717
Rake::TestTask.new(:ruby) do |test|
@@ -53,6 +53,11 @@ namespace :test do
5353
end
5454
end
5555

56+
desc %(Lint JavaScript files)
57+
task :lint_javascript do
58+
run_pnpm_script 'eslint'
59+
end
60+
5661
desc %(Regenerate JavaScript files)
5762
task :regenerate_javascript do
5863
run_pnpm_script 'build'

eslint.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import neostandard from 'neostandard'
2+
3+
export default [
4+
{
5+
ignores: [
6+
'coverage/**/*.js',
7+
'dist/**/*.js',
8+
'test/**/*.js',
9+
'vendor/**/*.js',
10+
]
11+
},
12+
...neostandard()
13+
]

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"homepage": "https://github.com/DavyJonesLocker/client_side_validations-simple_form",
2121
"scripts": {
22-
"build": "standard --verbose && rollup -c",
22+
"build": "rollup -c",
2323
"test": "test/javascript/run-qunit.mjs"
2424
},
2525
"devDependencies": {
@@ -28,10 +28,11 @@
2828
"@rollup/plugin-babel": "^6.0.3",
2929
"@rollup/plugin-node-resolve": "^15.2.1",
3030
"chrome-launcher": "^1.1.2",
31+
"eslint": "^9.12.0",
32+
"neostandard": "^0.11.6",
3133
"puppeteer-core": "^23.3.0",
3234
"rollup": "^4.21.3",
33-
"rollup-plugin-copy": "^3.5.0",
34-
"standard": "^17.1.2"
35+
"rollup-plugin-copy": "^3.5.0"
3536
},
3637
"peerDependencies": {
3738
"@client-side-validations/client-side-validations": "^0.4.0"

test/javascript/run-qunit.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ export default (async () => {
2525
return new Promise(resolve => setTimeout(resolve, ms))
2626
}
2727

28+
let browser
29+
2830
try {
2931
const chromeExecutablePath = chromeLauncher.Launcher.getInstallations()[0]
30-
const browser = await puppeteer.launch({ executablePath: chromeExecutablePath, headless: 'new' })
32+
browser = await puppeteer.launch({ executablePath: chromeExecutablePath, headless: 'new' })
3133
const page = await browser.newPage()
3234

3335
// Attach to browser console log events, and log to node console

0 commit comments

Comments
 (0)