Skip to content

Commit

Permalink
Get npm run lint working
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron committed Dec 12, 2024
1 parent a8a8b66 commit bcd233d
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 27 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

4 changes: 2 additions & 2 deletions .markdownlint-cli2.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const options = githubMarkdownOpinions.init({
'no-hard-tabs': false,
'first-line-heading': false,
'no-space-in-emphasis': false,
'blanks-around-fences': false
'blanks-around-fences': false,
})

module.exports = {
config: options,
customRules: ['@github/markdownlint-github'],
outputFormatters: [['markdownlint-cli2-formatter-pretty', {appendLink: true}]]
outputFormatters: [['markdownlint-cli2-formatter-pretty', {appendLink: true}]],
}
52 changes: 31 additions & 21 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
const eslintPlugin = require('eslint-plugin-eslint-plugin')
const eslintJs = require('@eslint/js')
const github = require('eslint-plugin-github')
const globals = require('globals')
const pluginJest = require('eslint-plugin-jest')

module.exports = [
github.getFlatConfigs().recommended,
eslintPlugin.configs['flat/recommended'],
eslintJs.configs.recommended,
{
languageOptions: {
parserOptions: {
ecmaVersion: 'latest',
},
},
env: {
commonjs: true,
node: true,
globals: {
...globals.commonjs,
...globals.node,
},
},
rules: {
'import/no-commonjs': 'off',
'importPlugin/no-commonjs': 'off',
'no-shadow': 'off',
'no-unused-vars': [
'error',
Expand All @@ -24,19 +26,27 @@ module.exports = [
},
],
},
overrides: [
{
files: ['**/*.test.js'],
env: {
jest: true,
},
},
{
files: ['.eslintrc.js'],
rules: {
'filenames/match-regex': 'off',
},
ignores: ['**/dist/**', '**/node_modules/**'],
},
{
files: ['**/*.test.js'],
languageOptions: {
globals: {
...pluginJest.environments.globals.globals,
},
],
}
},
},
{
files: ['.eslint.config.js', '.markdownlint-cli2.cjs'],
rules: {
'filenames/match-regex': 'off',
'github/filenames-match-regex': 'off',
},
},
{
files: ['src/url.js', 'src/rules/new-color-css-vars.js'],
rules: {
'importPlugin/extensions': 'off',
},
},
]
39 changes: 38 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"@github/markdownlint-github": "^0.6.3",
"@github/prettier-config": "0.0.6",
"eslint": "^9.16.0",
"@eslint/js": "^9.16.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-prettier": "^5.2.1",
"jest": "^29.7.0",
"markdownlint-cli2": "^0.14.0",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ module.exports = {
configs: {
recommended: require('./configs/recommended'),
},
getFlatConfigs: getFlatConfigs
getFlatConfigs,
}

0 comments on commit bcd233d

Please sign in to comment.