index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/mui
petrpan-code/mui/material-ui/.browserslistrc
[modern] last 1 chrome version last 1 edge version last 1 firefox version last 1 safari version node 14 # Default/Fallback # `npx browserslist --mobile-to-desktop "> 0.5%, last 2 versions, Firefox ESR, not dead, not IE 11"` when the last major is released. # Manually downgrading to ios_saf 12.4 for iPhone 6 and webpack 4 support. # On update, sync references where "#stable-snapshot" is mentioned in the codebase. [stable] and_chr 91 and_ff 89 and_qq 10.4 and_uc 12.12 android 91 baidu 7.12 chrome 90 edge 91 firefox 78 # 12.4 but 12.2-12.5 are treated equally in caniuse-lite. # Though caniuse-lite does not supporting finding an exact version in a range which is why `12.4` would result in "Unknown version 12.4 of ios_saf" ios_saf 12.2 kaios 2.5 op_mini all op_mob 73 opera 76 safari 14 samsung 13.0 # Same as `stable` but with IE 11 [legacy] ie 11 and_chr 91 and_ff 89 and_qq 10.4 and_uc 12.12 android 91 baidu 7.12 chrome 90 edge 91 firefox 78 ios_saf 12.2 kaios 2.5 op_mini all op_mob 73 opera 76 safari 14 samsung 13.0 # snapshot of `npx browserslist "maintained node versions"` # On update check all #stable-snapshot markers [node] node 12.0 # same as `node` [coverage] node 12.0 # same as `node` [development] node 12.0 # same as `node` [test] node 12.0 # same as `node` [benchmark] node 12.0
0
0
petrpan-code/mui
petrpan-code/mui/material-ui/.editorconfig
# EditorConfig is awesome: https://editorconfig.org/ # top-most EditorConfig file root = true [*.md] trim_trailing_whitespace = false [*.js] trim_trailing_whitespace = true # Unix-style newlines with a newline ending every file [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 insert_final_newline = true max_line_length = 100
1
0
petrpan-code/mui
petrpan-code/mui/material-ui/.eslintignore
/.git /.yarn /benchmark/**/dist /coverage /docs/export /docs/pages/playground/ /examples/material-ui-cra*/src/serviceWorker.js /examples/material-ui-gatsby/public/ /examples/material-ui-preact/config /examples/material-ui-preact/scripts /examples/material-ui-nextjs/src /packages/mui-codemod/lib /packages/mui-codemod/src/*/*.test/* /packages/mui-icons-material/fixtures /packages/mui-icons-material/legacy /packages/mui-icons-material/lib /packages/mui-icons-material/material-icons/ /packages/mui-icons-material/src/*.js /packages/mui-icons-material/templateSvgIcon.js /packages/mui-utils/macros/__fixtures__/ # Ignore fixtures /packages/typescript-to-proptypes/test/*/* /test/bundling/fixtures/**/*.fixture.js # just an import that reports eslint errors depending on whether the fixture (which is not checked in) exists /test/bundling/fixtures/create-react-app/src/index.js /test/bundling/fixtures/gatsby/.cache /test/bundling/fixtures/gatsby/public /tmp .next build node_modules .nyc_output # These come from crowdin. # If we would commit changes crowdin would immediately try to revert. # If we want to format these files we'd need to do it in crowdin docs/**/*-pt.md docs/**/*-zh.md
2
0
petrpan-code/mui
petrpan-code/mui/material-ui/.eslintrc.js
const path = require('path'); const { rules: baseStyleRules } = require('eslint-config-airbnb-base/rules/style'); const forbidTopLevelMessage = [ 'Prefer one level nested imports to avoid bundling everything in dev mode', 'See https://github.com/mui/material-ui/pull/24147 for the kind of win it can unlock.', ].join('\n'); // This only applies to packages published from this monorepo. // If you build a library around `@mui/material` you can safely use `createStyles` without running into the same issue as we are. const forbidCreateStylesMessage = 'Use `MuiStyles<ClassKey, Props>` instead if the styles are exported. Otherwise use `as const` assertions. ' + '`createStyles` will lead to inlined, at-compile-time-resolved type-imports. ' + 'See https://github.com/microsoft/TypeScript/issues/36097#issuecomment-578324386 for more information'; module.exports = { root: true, // So parent files don't get applied env: { es6: true, browser: true, node: true, }, extends: [ 'plugin:eslint-plugin-import/recommended', 'plugin:eslint-plugin-import/typescript', 'eslint-config-airbnb', 'eslint-config-airbnb-typescript', 'eslint-config-prettier', ], parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 7, }, plugins: [ 'eslint-plugin-material-ui', 'eslint-plugin-react-hooks', '@typescript-eslint/eslint-plugin', 'eslint-plugin-filenames', ], settings: { 'import/resolver': { webpack: { config: path.join(__dirname, './webpackBaseConfig.js'), }, }, }, /** * Sorted alphanumerically within each group. built-in and each plugin form * their own groups. */ rules: { 'consistent-this': ['error', 'self'], curly: ['error', 'all'], // Just as bad as "max components per file" 'max-classes-per-file': 'off', // Too interruptive 'no-alert': 'error', // Stylistic opinion 'arrow-body-style': 'off', // Allow warn and error for dev environments 'no-console': ['error', { allow: ['warn', 'error'] }], 'no-param-reassign': 'off', // It's fine. // Airbnb use warn https://github.com/airbnb/javascript/blob/63098cbb6c05376dbefc9a91351f5727540c1ce1/packages/eslint-config-airbnb-base/rules/style.js#L97 // but eslint recommands error 'func-names': 'error', 'no-restricted-imports': [ 'error', { patterns: [ '@mui/*/*/*', // Macros are fine since their import path is transpiled away '!@mui/utils/macros', '@mui/utils/macros/*', '!@mui/utils/macros/*.macro', ], }, ], 'no-continue': 'off', 'no-constant-condition': 'error', // Use the proptype inheritance chain 'no-prototype-builtins': 'off', 'no-underscore-dangle': 'error', 'nonblock-statement-body-position': 'error', 'prefer-arrow-callback': ['error', { allowNamedFunctions: true }], // Destructuring harm grep potential. 'prefer-destructuring': 'off', '@typescript-eslint/no-use-before-define': [ 'error', { functions: false, classes: true, variables: true, }, ], 'no-use-before-define': 'off', // disabled type-aware linting due to performance considerations '@typescript-eslint/dot-notation': 'off', 'dot-notation': 'error', // disabled type-aware linting due to performance considerations '@typescript-eslint/no-implied-eval': 'off', 'no-implied-eval': 'error', // disabled type-aware linting due to performance considerations '@typescript-eslint/no-throw-literal': 'off', 'no-throw-literal': 'error', // disabled type-aware linting due to performance considerations '@typescript-eslint/return-await': 'off', 'no-return-await': 'error', // Not sure why it doesn't work 'import/named': 'off', 'import/no-cycle': 'off', // Missing yarn workspace support 'import/no-extraneous-dependencies': 'off', // The code is already coupled to webpack. Prefer explicit coupling. 'import/no-webpack-loader-syntax': 'off', // doesn't work? 'jsx-a11y/label-has-associated-control': [ 'error', { // airbnb uses 'both' which requires nesting i.e. <label><input /></label> // 'either' allows `htmlFor` assert: 'either', }, ], // We are a library, we need to support it too 'jsx-a11y/no-autofocus': 'off', 'material-ui/docgen-ignore-before-comment': 'error', 'material-ui/rules-of-use-theme-variants': 'error', 'material-ui/no-empty-box': 'error', 'material-ui/straight-quotes': 'error', 'react-hooks/exhaustive-deps': ['error', { additionalHooks: 'useEnhancedEffect' }], 'react-hooks/rules-of-hooks': 'error', 'react/default-props-match-prop-types': [ 'error', { // Otherwise the rule thinks inner props = outer props // But in TypeScript we want to know that a certain prop is defined during render // while it can be ommitted from the callsite. // Then defaultProps (or default values) will make sure that the prop is defined during render allowRequiredDefaults: true, }, ], // Can add verbosity to small functions making them harder to grok. // Though we have to manually enforce it for function components with default values. 'react/destructuring-assignment': 'off', 'react/forbid-prop-types': 'off', // Too strict, no time for that 'react/jsx-curly-brace-presence': 'off', // broken // airbnb is using .jsx 'react/jsx-filename-extension': ['error', { extensions: ['.js', '.tsx'] }], // Prefer <React.Fragment> over <>. 'react/jsx-fragments': ['error', 'element'], // Enforces premature optimization 'react/jsx-no-bind': 'off', // We are a UI library. 'react/jsx-props-no-spreading': 'off', // This rule is great for raising people awareness of what a key is and how it works. 'react/no-array-index-key': 'off', 'react/no-danger': 'error', 'react/no-direct-mutation-state': 'error', // Not always relevant 'react/require-default-props': 'off', 'react/sort-prop-types': 'error', // This depends entirely on what you're doing. There's no universal pattern 'react/state-in-constructor': 'off', // stylistic opinion. For conditional assignment we want it outside, otherwise as static 'react/static-property-placement': 'off', 'no-restricted-syntax': [ // See https://github.com/eslint/eslint/issues/9192 for why it's needed ...baseStyleRules['no-restricted-syntax'], { message: "Do not import default or named exports from React. Use a namespace import (import * as React from 'react';) instead.", selector: 'ImportDeclaration[source.value="react"] ImportDefaultSpecifier, ImportDeclaration[source.value="react"] ImportSpecifier', }, { message: "Do not import default or named exports from ReactDOM. Use a namespace import (import * as ReactDOM from 'react-dom';) instead.", selector: 'ImportDeclaration[source.value="react-dom"] ImportDefaultSpecifier, ImportDeclaration[source.value="react-dom"] ImportSpecifier', }, { message: "Do not import default or named exports from ReactDOM. Use a namespace import (import * as ReactDOM from 'react-dom/client';) instead.", selector: 'ImportDeclaration[source.value="react-dom/client"] ImportDefaultSpecifier, ImportDeclaration[source.value="react-dom/client"] ImportSpecifier', }, { message: "Do not import default or named exports from ReactDOMServer. Use a namespace import (import * as ReactDOM from 'react-dom/server';) instead.", selector: 'ImportDeclaration[source.value="react-dom/server"] ImportDefaultSpecifier, ImportDeclaration[source.value="react-dom/server"] ImportSpecifier', }, ], // We re-export default in many places, remove when https://github.com/airbnb/javascript/issues/2500 gets resolved 'no-restricted-exports': 'off', // Some of these occurences are deliberate and fixing them will break things in repos that use @monorepo dependency 'import/no-relative-packages': 'off', // Avoid accidental auto-"fixes" https://github.com/jsx-eslint/eslint-plugin-react/issues/3458 'react/no-invalid-html-attribute': 'off', 'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }], 'lines-around-directive': 'off', }, overrides: [ { files: [ // matching the pattern of the test runner '*.test.mjs', '*.test.js', '*.test.mjs', '*.test.ts', '*.test.tsx', ], extends: ['plugin:mocha/recommended'], rules: { // does not work with wildcard imports. Mistakes will throw at runtime anyway 'import/named': 'off', 'material-ui/disallow-active-element-as-key-event-target': 'error', // upgraded level from recommended 'mocha/no-exclusive-tests': 'error', 'mocha/no-skipped-tests': 'error', // no rationale provided in /recommended 'mocha/no-mocha-arrows': 'off', // definitely a useful rule but too many false positives // due to `describeConformance` // "If you're using dynamically generated tests, you should disable this rule."" 'mocha/no-setup-in-describe': 'off', // `beforeEach` for a single case is optimized for change // when we add a test we don't have to refactor the existing // test to `beforeEach`. // `beforeEach`+`afterEach` also means that the `beforeEach` // is cleaned up in `afterEach` if the test causes a crash 'mocha/no-hooks-for-single-case': 'off', // disable eslint-plugin-jsx-a11y // tests are not driven by assistive technology // add `jsx-a11y` rules once you encounter them in tests 'jsx-a11y/click-events-have-key-events': 'off', 'jsx-a11y/control-has-associated-label': 'off', 'jsx-a11y/iframe-has-title': 'off', 'jsx-a11y/label-has-associated-control': 'off', 'jsx-a11y/mouse-events-have-key-events': 'off', 'jsx-a11y/no-noninteractive-tabindex': 'off', 'jsx-a11y/no-static-element-interactions': 'off', 'jsx-a11y/tabindex-no-positive': 'off', // In tests this is generally intended. 'react/button-has-type': 'off', // They are accessed to test custom validator implementation with PropTypes.checkPropTypes 'react/forbid-foreign-prop-types': 'off', // components that are defined in test are isolated enough // that they don't need type-checking 'react/prop-types': 'off', 'react/no-unused-prop-types': 'off', }, }, { files: ['docs/src/modules/components/**/*.js'], rules: { 'material-ui/no-hardcoded-labels': [ 'error', { allow: ['MUI', 'Twitter', 'GitHub', 'Stack Overflow'] }, ], }, }, // Next.js plugin { files: ['docs/**/*'], extends: ['plugin:@next/next/recommended'], settings: { next: { rootDir: 'docs', }, }, rules: { // We're not using the Image component at the moment '@next/next/no-img-element': 'off', }, }, // Next.js entry points pages { files: ['docs/pages/**/*.js'], rules: { 'react/prop-types': 'off', }, }, // demos { files: ['docs/src/pages/**/*{.tsx,.js}', 'docs/data/**/*{.tsx,.js}'], rules: { // This most often reports data that is defined after the component definition. // This is safe to do and helps readability of the demo code since the data is mostly irrelevant. '@typescript-eslint/no-use-before-define': 'off', 'react/prop-types': 'off', 'no-alert': 'off', 'no-console': 'off', }, }, // demos - proptype generation { files: ['docs/data/base/components/modal/UseModal.js'], rules: { 'consistent-return': 'off', 'func-names': 'off', 'no-else-return': 'off', 'prefer-template': 'off', }, }, { files: ['docs/data/**/*{.tsx,.js}'], excludedFiles: [ 'docs/data/joy/getting-started/templates/**/*.tsx', 'docs/data/**/css/*{.tsx,.js}', 'docs/data/**/system/*{.tsx,.js}', 'docs/data/**/tailwind/*{.tsx,.js}', ], rules: { 'filenames/match-exported': ['error'], }, }, { files: ['*.d.ts'], rules: { 'import/export': 'off', // Not sure why it doesn't work }, }, { files: ['*.tsx'], excludedFiles: '*.spec.tsx', rules: { // WARNING: If updated, make sure these rules are merged with `no-restricted-imports` (#ts-source-files) 'no-restricted-imports': [ 'error', { patterns: [ // Allow deeper imports for TypeScript types. TODO remove '@mui/*/*/*/*', // Macros are fine since they're transpiled into something else '!@mui/utils/macros/*.macro', ], }, ], }, }, // Files used for generating TypeScript declaration files (#ts-source-files) { files: ['packages/*/src/**/*.tsx'], excludedFiles: '*.spec.tsx', rules: { 'no-restricted-imports': [ 'error', { paths: [ { name: '@mui/material/styles', importNames: ['createStyles'], message: forbidCreateStylesMessage, }, { name: '@mui/styles', importNames: ['createStyles'], message: forbidCreateStylesMessage, }, { name: '@mui/styles/createStyles', message: forbidCreateStylesMessage, }, ], patterns: [ // Allow deeper imports for TypeScript types. TODO? '@mui/*/*/*/*', // Macros are fine since they're transpiled into something else '!@mui/utils/macros/*.macro', ], }, ], 'react/prop-types': 'off', }, }, { files: ['*.spec.tsx', '*.spec.ts'], rules: { 'no-alert': 'off', 'no-console': 'off', 'no-empty-pattern': 'off', 'no-lone-blocks': 'off', 'no-shadow': 'off', '@typescript-eslint/no-unused-expressions': 'off', '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-use-before-define': 'off', // Not sure why it doesn't work 'import/export': 'off', 'import/prefer-default-export': 'off', 'jsx-a11y/anchor-has-content': 'off', 'jsx-a11y/anchor-is-valid': 'off', 'jsx-a11y/tabindex-no-positive': 'off', 'react/default-props-match-prop-types': 'off', 'react/no-access-state-in-setstate': 'off', 'react/no-unused-prop-types': 'off', 'react/prefer-stateless-function': 'off', 'react/prop-types': 'off', 'react/require-default-props': 'off', 'react/state-in-constructor': 'off', 'react/static-property-placement': 'off', 'react/function-component-definition': 'off', }, }, { files: ['packages/typescript-to-proptypes/src/**/*.ts'], rules: { // Working with flags is common in TypeScript compiler 'no-bitwise': 'off', }, }, { files: ['packages/*/src/**/*{.ts,.tsx,.js}'], excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx'], rules: { 'no-restricted-imports': [ 'error', { paths: [ { name: '@mui/material', message: forbidTopLevelMessage, }, { name: '@mui/lab', message: forbidTopLevelMessage, }, ], }, ], 'import/no-cycle': ['error', { ignoreExternal: true }], }, }, { files: ['packages/*/src/**/*{.ts,.tsx,.js}'], excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx', 'packages/mui-joy/**/*{.ts,.tsx,.js}'], rules: { 'material-ui/mui-name-matches-component-name': [ 'error', { customHooks: [ 'useDatePickerDefaultizedProps', 'useDateTimePickerDefaultizedProps', 'useTimePickerDefaultizedProps', ], }, ], }, }, { files: ['test/bundling/scripts/**/*.js'], rules: { // ES modules need extensions 'import/extensions': ['error', 'ignorePackages'], }, }, { files: ['scripts/**/*.mjs', 'packages/**/*.mjs'], rules: { 'import/extensions': ['error', 'ignorePackages'], }, }, { files: ['packages/mui-base/src/**/**{.ts,.tsx}'], rules: { 'import/no-default-export': 'error', 'import/prefer-default-export': 'off', }, }, ], };
3
0
petrpan-code/mui
petrpan-code/mui/material-ui/.markdownlint-cli2.cjs
const straightQuotes = require('./packages/markdownlint-rule-mui/straight-quotes'); const gitDiff = require('./packages/markdownlint-rule-mui/git-diff'); const tableAlignment = require('./packages/markdownlint-rule-mui/table-alignment'); const terminalLanguage = require('./packages/markdownlint-rule-mui/terminal-language'); // https://github.com/DavidAnson/markdownlint#rules--aliases module.exports = { config: { default: true, MD004: false, // MD004/ul-style. Buggy MD009: { // MD009/no-trailing-spaces br_spaces: 0, strict: true, list_item_empty_lines: false, }, MD013: false, // MD013/line-length. Already handled by Prettier. MD014: false, // MD014/commands-show-output. It's OK. MD024: { siblings_only: true }, // MD024/no-duplicate-heading/no-duplicate-header MD025: { // Heading level level: 1, // RegExp for matching title in front matter front_matter_title: '', }, MD033: false, // MD033/no-inline-html. We use it from time to time, it's fine. MD034: false, // MD034/no-bare-urls. Not a concern for us, our Markdown interpreter supports it. MD028: false, // MD028/no-blanks-blockquote prevent double blockquote MD029: false, // MD029/ol-prefix. Buggy MD031: false, // MD031/blanks-around-fences Some code blocks inside li MD036: false, // MD036/no-emphasis-as-heading/no-emphasis-as-header. It's OK. MD051: false, // MD051/link-fragments. Many false positives in the changelog. MD052: false, // MD052/reference-links-images. Many false positives in the changelog. straightQuotes: true, gitDiff: true, tableAlignment: true, terminalLanguage: true, }, customRules: [straightQuotes, gitDiff, tableAlignment, terminalLanguage], ignores: [ 'CHANGELOG.old.md', '**/node_modules/**', '**/*-zh.md', '**/*-pt.md', '**/build/**', '.github/PULL_REQUEST_TEMPLATE.md', ], };
4
0
petrpan-code/mui
petrpan-code/mui/material-ui/.mocharc.js
module.exports = { extension: ['js', 'mjs', 'ts', 'tsx'], ignore: [ '**/build/**', '**/node_modules/**', // Mocha seems to ignore .next anyway (maybe because dotfiles?). // We're leaving this to make sure. 'docs/.next/**', ], recursive: true, timeout: (process.env.CIRCLECI === 'true' ? 5 : 2) * 1000, // Circle CI has low-performance CPUs. reporter: 'dot', require: ['@mui-internal/test-utils/setupBabel', '@mui-internal/test-utils/setupJSDOM'], 'watch-ignore': [ // default '.git', // node_modules can be nested with workspaces '**/node_modules/**', // Unrelated directories with a large number of files '**/build/**', 'docs/.next/**', ], };
5
0
petrpan-code/mui
petrpan-code/mui/material-ui/.stylelintrc.js
module.exports = { extends: 'stylelint-config-standard', ignoreFiles: [ // TypeScript declaration files contain no styles. // Stylelint is also reporting parseError on `docs/types/react-docgen.d.ts`. '**/*.d.ts', ], rules: { 'alpha-value-notation': null, 'custom-property-pattern': null, 'declaration-colon-newline-after': null, 'function-parentheses-newline-inside': null, // not compatible with prettier 'media-feature-range-notation': null, 'no-empty-source': null, 'no-missing-end-of-source-newline': null, 'selector-class-pattern': null, 'string-no-newline': null, // not compatible with prettier 'value-keyword-case': null, 'value-list-comma-newline-after': null, // not compatible with prettier }, overrides: [ { files: ['**/*.js', '**/*.cjs', '**/*.mjs', '**/*.jsx', '**/*.ts', '**/*.tsx'], customSyntax: 'postcss-styled-syntax', }, ], };
6
0
petrpan-code/mui
petrpan-code/mui/material-ui/.tidelift.yml
ci: platform: npm: # Don't run unmainted test on nomnom, it's only used by build tools, not in MUI. nomnom: tests: unmaintained: skip # Don't run vulnerabity test on os-locale, it's only used by yargs in build tools, not in MUI. os-locale: tests: vulnerable: skip
7
0
petrpan-code/mui
petrpan-code/mui/material-ui/.vale.ini
# Config vale. More information at https://docs.errata.ai/vale/config StylesPath = .github/styles MinAlertLevel = suggestion Packages = Google [*.md] # Ignore code injection which start with {{... BlockIgnores = {{.* # Custom syle # BasedOnStyles = Blog Blog.ComposedWords = YES Blog.NamingConventions = YES Blog.Typos = YES # Google: Google.FirstPerson = YES # Avoid first-person pronouns such as I, me, ...'. Google.GenderBias = YES # Avoid gendered profession Google.OxfordComma = YES Google.Quotes = YES # Commas and periods go inside quotation marks. Google.Spelling = YES #In general, use American spelling (word ending with 'nised' or 'logue') Google.We = YES # Try to avoid using first-person plural Google.Latin = YES # Try to avoid latin expressions e.g. and i.e. # Those rules are not repected a lot # Google.Passive = YES # In general, use active voice instead of passive voice. Google.Will = YES # Avoid using will # False positives with "1st" nearly no use in our doc # Google.Units = YES # Put a nonbreaking space between the number and the unit
8
0
petrpan-code/mui
petrpan-code/mui/material-ui/.yarnrc
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 network-timeout 150000 yarn-path ".yarn/releases/yarn-1.22.19.js"
9
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
166
Edit dataset card

Models trained or fine-tuned on petrpan26/typescript-code