Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

22 changes: 11 additions & 11 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: CI/CD

on:
push:
pull_request:
workflow_dispatch:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
lint-commits:
Expand All @@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
cache: "npm"
- run: npm ci --ignore-scripts
- run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
Expand All @@ -30,12 +30,12 @@ jobs:
strategy:
matrix:
# add/remove versions as we move support forward
node-version: [20, 22]
node-version: [22, 24, 26]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v6.4.0
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
Expand All @@ -52,11 +52,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6.0.3
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v6.4.0
with:
node-version: 22
node-version: 24
cache: "npm"
- run: npm ci
- name: Release
Expand Down
111 changes: 111 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import js from '@eslint/js'
import tseslint from 'typescript-eslint'
import unicorn from 'eslint-plugin-unicorn'
import nodePlugin from 'eslint-plugin-n'
import globals from 'globals'

const customRules = {
'no-useless-constructor': 'warn',
'prefer-object-spread': 'warn',
'no-template-curly-in-string': 'off',
'newline-before-return': 'off',
'padding-line-between-statements': 'off',
'quote-props': ['error', 'consistent'],
'capitalized-comments': 'off',
'arrow-body-style': 'off',
'comma-dangle': 'off',
'complexity': 'off',
'max-depth': 'off',
'object-shorthand': 'off',
'operator-linebreak': 'off',
'object-curly-spacing': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/empty-brace-spaces': 'off',
'unicorn/no-this-assignment': 'off',
'unicorn/prefer-ternary': 'off',
'unicorn/no-array-for-each': 'warn',
'unicorn/prefer-logical-operator-over-ternary': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/prefer-spread': 'off',
'unicorn/switch-case-braces': 'off',
'unicorn/no-null': 'off',
'unicorn/text-encoding-identifier-case': 'off',
'unicorn/no-instanceof-builtins': 'off',
'unicorn/prefer-at': 'off',
'unicorn/prefer-switch': 'off',
'unicorn/no-immediate-mutation': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/consistent-existence-index-check': 'off',
'unicorn/consistent-compound-words': 'off',
'unicorn/prefer-split-limit': 'off'
}

const styleRules = {
indent: ['error', 'tab', {SwitchCase: 1}],
semi: ['error', 'never'],
quotes: ['error', 'single', {avoidEscape: true}],
'no-unexpected-multiline': 'error'
}

const tsCustomRules = {
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}

export default tseslint.config(
{
ignores: [
'coverage/**',
'docs/**',
'docsrc/**',
'scripts/**',
'node_modules/**'
]
},
js.configs.recommended,
unicorn.configs.recommended,
{
files: ['**/*.js'],
...nodePlugin.configs['flat/recommended-script'],
languageOptions: {
sourceType: 'commonjs',
globals: {
...globals.node
}
},
rules: {
...nodePlugin.configs['flat/recommended-script'].rules,
...styleRules,
...customRules,
'n/file-extension-in-import': 'off',
'n/prefer-global/process': 'off',
// Allow `_`-prefixed identifiers as intentional throwaways (e.g. `_ => {}`).
'no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}]
}
},
{
files: ['**/*.ts'],
extends: [tseslint.configs.recommended],
rules: {
...styleRules,
...customRules,
...tsCustomRules
}
},
{
files: ['test/**/*.{js,ts}', 'config/jest.setup.js'],
languageOptions: {
globals: {
...globals.jest
}
}
}
)
2 changes: 1 addition & 1 deletion lib/pages/link-setting.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export enum LinkStyle {
* does not replace the current configuration page window.
* ```
* section.linkSetting('moreInfo')
* .url('http://www.smartthings.com')
* .url('https://www.smartthings.com')
* ```
*/
export class LinkSetting extends SectionSetting<LinkSetting> {
Expand Down
Loading