Skip to content

Commit

Permalink
CI: Upgrade eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Margen67 committed Jan 31, 2025
1 parent e39d32a commit 1eb2604
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ on:
branches-ignore: [wip, nohash]
paths:
- '.github/workflows/ci.yml'
- 'eslint.config.js'
- 'package.json'
- 'patches/*.patch.toml'
pull_request:
branches-ignore: [wip, nohash]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
!.gitignore

!/.github/**/*
!/eslint.config.js
!/package.json
!/patches/*.patch.toml
55 changes: 55 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import eslintPluginToml from 'eslint-plugin-toml'
import stylistic from '@stylistic/eslint-plugin'
export default [
...eslintPluginToml.configs['flat/recommended'],
{
plugins: {
'@stylistic': stylistic
},
rules: {
'@stylistic/eol-last': [
'error',
'always'
],
'@stylistic/indent': 'error',
'@stylistic/linebreak-style': [
'error',
'unix'
],
'@stylistic/no-mixed-spaces-and-tabs': 'error',
'@stylistic/no-multi-spaces': [
'error',
{
'ignoreEOLComments': true
}
],
'@stylistic/no-multiple-empty-lines': [
'error',
{
'max': 1,
'maxBOF': 0,
'maxEOF': 0
}
],
'@stylistic/no-tabs': 'error',
'@stylistic/no-trailing-spaces': 'error',
'toml/indent': [
'error',
4,
{
'subTables': 1,
'keyValuePairs': 1
}
],
'toml/padding-line-between-tables': 'off',
'toml/spaced-comment': 'off',
'toml/tables-order': 'off',
'toml/no-mixed-type-in-array': 'error',
'unicode-bom': 'error'
},
ignores: [
'/*.toml',
'**/*.config.toml'
],
}
];
50 changes: 4 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,8 @@
{
"eslintConfig": {
"extends": "plugin:toml/standard",
"rules": {
"toml/indent": [
"error",
4,
{
"subTables": 1,
"keyValuePairs": 1
}
],
"toml/padding-line-between-tables": "off",
"toml/spaced-comment": "off",
"toml/tables-order": "off",
"toml/no-mixed-type-in-array": "error",
"eol-last": [
"error",
"always"
],
"indent": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": [
"error",
{
"ignoreEOLComments": true
}
],
"no-multiple-empty-lines": [
"error",
{
"max": 1,
"maxBOF": 0,
"maxEOF": 0
}
],
"no-tabs": "error",
"no-trailing-spaces": "error",
"unicode-bom": "error"
}
},
"eslintIgnore": [
"/*.toml",
"**/*.config.toml"
],
"type": "module",
"devDependencies": {
"eslint": "^8.45.0",
"eslint-plugin-toml": "^0.5.0"
"eslint": "latest",
"eslint-plugin-toml": "latest",
"@stylistic/eslint-plugin": "latest"
}
}

0 comments on commit 1eb2604

Please sign in to comment.