-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5e9f08
commit cad3b06
Showing
17 changed files
with
1,628 additions
and
1,617 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
const babelParser = require('@babel/eslint-parser'); | ||
const js = require('@eslint/js'); | ||
const prettier = require('eslint-config-prettier'); | ||
const importPlugin = require('eslint-plugin-import'); | ||
const jest = require('eslint-plugin-jest'); | ||
const jestDOM = require('eslint-plugin-jest-dom'); | ||
const simpleImportSort = require('eslint-plugin-simple-import-sort'); | ||
const globals = require('globals'); | ||
|
||
module.exports = [ | ||
{ | ||
ignores: [ | ||
'.git/*', | ||
'.nyc_output/*', | ||
'.vscode/*', | ||
'.yarn/*', | ||
'.yarnrc.yml', | ||
'coverage/*', | ||
'dist/*', | ||
'docs/*', | ||
'herman/*', | ||
'node_modules/*', | ||
], | ||
}, | ||
js.configs.recommended, | ||
importPlugin.flatConfigs.recommended, | ||
prettier, | ||
{ | ||
files: ['**/*.{js,mjs,cjs,ts,cts,mts}'], | ||
languageOptions: { | ||
parser: babelParser, | ||
globals: { | ||
...globals.node, | ||
...globals.es2021, | ||
}, | ||
parserOptions: { | ||
sourceType: 'script', | ||
}, | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
node: {}, | ||
webpack: { | ||
config: { | ||
resolve: { | ||
modules: ['templates/client', 'scss', 'node_modules'], | ||
alias: { | ||
jquery: 'jquery/dist/jquery.slim', | ||
nunjucks: 'nunjucks/browser/nunjucks-slim', | ||
}, | ||
}, | ||
resolveLoader: { | ||
alias: { | ||
sassjson: 'sass-json-loader', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
'import/external-module-folders': ['node_modules'], | ||
}, | ||
rules: { | ||
'no-console': 1, | ||
'no-warning-comments': ['warn', { terms: ['todo', 'fixme', '@@@'] }], | ||
'import/first': 'warn', | ||
'import/newline-after-import': 'warn', | ||
'import/no-duplicates': ['error', { 'prefer-inline': true }], | ||
'import/order': [ | ||
'warn', | ||
{ 'newlines-between': 'always', alphabetize: { order: 'asc' } }, | ||
], | ||
'import/named': 'warn', | ||
}, | ||
}, | ||
{ | ||
files: ['assets/js/**/*.{js,mjs,cjs,ts,cts,mts}'], | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.commonjs, | ||
...globals.jquery, | ||
...globals.es2021, | ||
}, | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
}, | ||
plugins: { 'simple-import-sort': simpleImportSort }, | ||
rules: { | ||
'simple-import-sort/imports': 'warn', | ||
'simple-import-sort/exports': 'warn', | ||
'import/order': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**/*.{js,ts}'], | ||
languageOptions: { | ||
globals: { | ||
...globals.mocha, | ||
...globals.es2021, | ||
}, | ||
}, | ||
rules: { | ||
'func-names': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['test/clientjs/**/*.{js,ts}'], | ||
languageOptions: { | ||
globals: { | ||
...jest.environments.globals.globals, | ||
...globals.browser, | ||
...globals.jquery, | ||
...globals.es2021, | ||
}, | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
}, | ||
plugins: { | ||
jest, | ||
'jest-dom': jestDOM, | ||
'simple-import-sort': simpleImportSort, | ||
}, | ||
rules: { | ||
'simple-import-sort/imports': 'warn', | ||
'simple-import-sort/exports': 'warn', | ||
'import/order': 'off', | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.